KatInterview

practice a little every day — you've got this ♡

Interview Practice Problems

Practice 5997 original coding, SQL, system design, machine learning and behavioral problems across 15 topics. Coding and SQL problems run against hidden test cases right in your browser; every problem has hints and a worked solution, free.

5997
Problems
2221
Auto-graded
15
Topics
270
Added today

Showing 1741–1770 of 2221 results

  • Trees & GraphsMediumAuto-graded
    Lexicographically Smallest Schedule or Detect a Deadlock

    Tests Kahn's algorithm with a min-heap to produce the lexicographically smallest valid processing order across nodes in a directed dependency graph, or detect a cycle.

    Trees & Graphstopological-sortgraphsheap
  • Arrays & HashingMediumAuto-graded
    Zero-Sum Triplets in an Array

    Tests two-pointer technique on sorted arrays, duplicate avoidance, and quadratic complexity optimization for finding triplet combinations.

    Arrays & Hashingtwo-pointerssortingarray-traversal
  • Data Structure DesignHardAuto-graded
    Sliding-Window Event Counter with a Circular Bucket Buffer

    Design a fixed-memory event counter using a ring buffer of per-second buckets that tracks how many events fell inside a trailing 15-minute window.

    Data Structure Designring-buffersliding-windowdesignsimulation
  • Trees & GraphsMediumAuto-graded
    Spell Words Along Connected Paths in a Letter Grid

    Tests backtracking DFS with trie-based pruning to find all words from a large list that can be traced through edge-adjacent, non-repeating cells in a 2-D letter grid.

    Trees & Graphsbacktrackingtriedfs
  • Arrays & HashingMediumAuto-graded
    Sliding Window Average over an Integer Sequence

    Tests whether a candidate can compute consecutive fixed-width window averages in O(n) time by maintaining a running sum instead of recomputing each window from scratch.

    Arrays & Hashingsliding-windowarraystwo-pointers
  • StringsMediumAuto-graded
    Text Substitution with Whole-Word Match and Longest-Prefix Priority

    Apply a phrase-to-replacement map on the original text in one pass, respecting whole-word boundaries and preferring longer matches.

    Stringstriegreedystring-matching
  • Stacks & QueuesMediumAuto-graded
    Lexicographically Smallest Digit Sequence from Rise/Fall Pattern

    Tests greedy thinking and stack-based reversal to build the smallest digit string satisfying a sequence of increase and decrease constraints.

    Stacks & Queuesgreedystackstrings
  • StringsEasyAuto-graded
    Scale Serving Sizes in a Shopping List

    Tests careful string parsing: multiply only the leading numeric token in each line while leaving the rest of the text exactly as-is.

    Stringsstringsparsinglist manipulation
  • SQL & DataMediumAuto-graded
    Top 5 Delivery Routes by Fuel Efficiency

    Tests aggregating trip data across two tables, guarding against division by zero, and ranking results with a deterministic tie-break.

    SQL & Dataaggregationfilteringsorting
  • StringsHardAuto-graded
    Detect a Contiguous Block Inside an Integer Sequence

    Tests the ability to determine whether one integer array appears as an unbroken, in-order block inside a larger array using linear-time pattern matching.

    StringsKMPpattern matchingarrayssubsequence
  • Arrays & HashingMediumAuto-graded
    Collect Characters by Walking a Grid

    Tests grid traversal with directional commands, run-length encoding, and boundary/obstacle validation.

    Arrays & Hashingmatrixsimulationstring-building
  • Trees & GraphsMediumAuto-graded
    Find Valid Completion Sequence for Dependent Tasks

    Tests understanding of topological sorting, dependency graph modeling, and cycle detection in directed acyclic graphs.

    Trees & Graphstopological-sortgraphsbfscycle-detection
  • Greedy & IntervalsMediumAuto-graded
    Maximize Pay by Filling Gaps in a Shift Schedule

    Tests greedy reasoning and run-based reformulation to optimally spend a limited number of schedule changes for maximum earnings with streak bonuses.

    Greedy & Intervalsgreedydynamic-programmingarrays
  • Data Structure DesignMediumAuto-graded
    Cart History: Undo and Redo Item Changes

    Design a cart with reversible add/remove operations, tracking change history with undo/redo stacks.

    Data Structure Designdata-structuresstackstate-management
  • Data Structure DesignMediumAuto-graded
    Hierarchical Resource Tree Operations

    Tests tree manipulation with parent-child relationships, path reconstruction, and cycle prevention during node relocation.

    Data Structure Designtreeshash-mapsgraphscycle-detection
  • StringsHardAuto-graded
    Find Next Larger Palindrome Within Digit Limit

    Tests constructing the immediate successor palindrome by manipulating the left half, handling carries, length transitions, and an upper bound.

    Stringspalindromesstring-manipulationgreedy
  • Heaps, Sorting & SearchMediumAuto-graded
    Combine K Sorted Sequences into One

    Tests whether a candidate can use a min-heap to efficiently merge multiple sorted lists into a single sorted output in O(N log k) time.

    Heaps, Sorting & Searchheapmergesorting
  • StringsMediumAuto-graded
    Character Removal Anagram Matching

    Tests string manipulation and character frequency analysis to determine if two strings can become anagrams through optional single-character removal.

    Stringshash-mapcountinganagrams
  • Trees & GraphsEasyAuto-graded
    Paint Bucket: Recolor a 4-Connected Region in a Grid

    Tests BFS/DFS grid traversal by spreading a new color through all 4-directionally connected cells sharing the starting cell's original color.

    Trees & Graphsbfsgridgraph-traversal
  • Data Structure DesignMediumAuto-graded
    Process Event Listener Operations

    Tests understanding of the observer pattern through ordered listener management, callback registration/removal, and event dispatch simulation.

    Data Structure Designobserver-patterndata-structuresstate-management
  • Trees & GraphsMediumAuto-graded
    Cluster Interchangeable Words by Surrounding Context

    Tests context hashing, union-find for transitive closure, and precise output formatting to group words that are mutually substitutable in identical four-word windows.

    Trees & Graphsunion-findhashingstrings
  • Trees & GraphsMediumAuto-graded
    Shortest Path Through a Network With Hazardous Nodes

    Tests BFS on filtered graphs and Dijkstra with lexicographic two-criteria cost to navigate networks while minimizing hazardous-node visits then total hops.

    Trees & Graphsbfsdijkstrashortest-path
  • StringsMediumAuto-graded
    Maximum Unique Character Window Length

    Tests sliding window technique with hash map indexing to efficiently find the longest substring with all distinct characters.

    Stringssliding-windowhash-maptwo-pointers
  • Data Structure DesignHardAuto-graded
    Live String Index Store with Closest-Match Queries

    Tests ability to design a data structure that supports streaming character appends, point updates, and O(log N) nearest-occurrence queries over a mutable string.

    Data Structure Designordered-settreapbinary-search-treedesign
  • Data Structure DesignHardAuto-graded
    Simulate a Time-Aware Key-Value Store with Transactions

    Tests implementation of an in-memory store combining TTL expiration, a logical clock, and atomic single-transaction semantics with rollback.

    Data Structure Designhash-maptransactionssimulation
  • Arrays & HashingMediumAuto-graded
    Reorganize Array Elements by Hash-Based Bucket Assignment

    Tests understanding of parallel counting, prefix sums, and scatter operations to group array elements into contiguous buckets.

    Arrays & Hashingcountingprefix-sumpartitioning
  • Arrays & HashingMediumAuto-graded
    Difference in Proportions Confidence Interval

    Tests understanding of statistical inference by computing a confidence interval for the difference between two independent proportions.

    Arrays & Hashingstatisticshypothesis-testingconfidence-intervalsexperimental-design
  • Trees & GraphsMediumAuto-graded
    Assemble a Binary Tree from Two Traversals, Output by Level

    Tests whether a candidate can reconstruct a unique binary tree from its preorder and inorder sequences and serialize the result breadth-first with null markers.

    Trees & Graphsbinary-treetraversalBFSiterative
  • Math & Bit ManipulationMediumAuto-graded
    Count Days Between Two Dates

    Tests efficient calendar arithmetic by computing date intervals without iteration, requiring leap year logic and modular reasoning.

    Math & Bit Manipulationmathcalendarmodular-arithmetic
  • StringsMediumAuto-graded
    Minimum Edits to Make a String k-Palindromic

    Tests the ability to combine classic edit-distance dynamic programming with palindrome structure to find the minimum single-character substitutions needed to make a string palindromic after removing exactly k characters.

    Stringsstringsdynamic-programmingedit-operations