KatInterview

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

Interview Practice Problems

Practice 6019 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.

6019
Problems
2229
Auto-graded
15
Topics
276
Added today

Showing 1381–1410 of 2229 results

  • Heaps, Sorting & SearchMediumAuto-graded
    Three-Way Color Partition

    Tests the ability to partition an array into three distinct categories using a single-pass, constant-space algorithm.

    Heaps, Sorting & Searcharraystwo-pointerssortingpartitioning
  • Arrays & HashingMediumAuto-graded
    Merge Two Sorted Lists Into a Padded Buffer

    Merge a sorted list into the sorted prefix of a larger list that ends with unused slots, writing in place with constant extra memory.

    Arrays & Hashingtwo-pointersin-placesorted-arraysmerge
  • Trees & GraphsMediumAuto-graded
    Group Serialized Tree Values by Depth

    Parse a LeetCode-style level-order array and return values grouped into nested lists by depth, preserving left-to-right order.

    Trees & Graphstreesbfsarrays
  • Arrays & HashingMediumAuto-graded
    Count Close Triplets Within a Value Range

    Tests sorting, sliding window, and combinatorial counting to find how many index-distinct triplets fit within a given value spread.

    Arrays & Hashingsliding-windowsortingcombinatorics
  • Arrays & HashingMediumAuto-graded
    Grid Walk With Clockwise Redirects at Walls and Obstacles

    Tests grid simulation by traversing a matrix in a right-biased clockwise walk that turns at boundaries, visited cells, and blocked positions until no move is possible.

    Arrays & Hashingmatrixsimulationgrid
  • Dynamic ProgrammingHardAuto-graded
    Enumerate All Possible Tic-Tac-Toe Game Paths

    Tests recursive game-tree traversal with memoization to count distinct play sequences by outcome.

    Dynamic Programmingrecursionmemoizationgame-theory
  • Trees & GraphsMediumAuto-graded
    Shared Manager in Organizational Hierarchy

    Tests tree traversal, ancestor queries, and handling multiple input formats with a custom precedence rule.

    Trees & Graphstreeslowest-common-ancestorgraph-traversal
  • Trees & GraphsMediumAuto-graded
    Fill Rooms With Distance to Nearest Exit

    Tests multi-source BFS on a grid to propagate shortest walking distances from all exits simultaneously to every reachable empty room.

    Trees & Graphsbfsgraphsgrid
  • Dynamic ProgrammingMediumAuto-graded
    Longest Strictly Increasing Subsequence

    Tests understanding of dynamic programming optimization using binary search and greedy subsequence construction with the patience sorting technique.

    Dynamic Programmingbinary-searchsubsequencesgreedy
  • Arrays & HashingMediumAuto-graded
    Stable Grouping and Column Gravity

    Tests stable partitioning of categorized strings and simulating gravity on independent grid columns

    Arrays & Hashingarrayssortingsimulationtwo-pointers
  • Trees & GraphsMediumAuto-graded
    Root-to-Leaf Path Metrics on a Weighted Tree

    Tests whether a candidate can traverse an unordered weighted tree in linear time to extract the root, the heaviest root-to-leaf path weight, and the maximum depth.

    Trees & Graphstrees-graphshash-mapiterative-dfs
  • Arrays & HashingHardAuto-graded
    Estimating the Probability of a Dice Sum Exceeding a Target

    Apply the central limit theorem and continuity correction to approximate the tail probability of a sum of independent discrete random variables.

    Arrays & Hashingprobabilitycentral-limit-theoremnormal-approximationcontinuity-correction
  • Dynamic ProgrammingMediumAuto-graded
    Worst Equity Drop, Best Trade, and Fewest Coins

    Return a series' steepest peak-to-trough drop with its indices, the best one-buy-one-sell gain, and the minimum coin count for a target.

    Dynamic Programmingarraysdynamic-programminggreedysingle-pass
  • Arrays & HashingMediumAuto-graded
    Evaluate Request Status from Rule Matches

    Tests rule-based decision logic with subset matching and outcome priority resolution when multiple rules apply simultaneously.

    Arrays & Hashingset-operationslogicprecedence
  • Greedy & IntervalsMediumAuto-graded
    Fewest Points to Cover a Microdollar Threshold

    Tests greedy selection when items have uniform cost but different values under capacity constraints.

    Greedy & Intervalsgreedysortingmath
  • Heaps, Sorting & SearchMediumAuto-graded
    Collect minimum values with adjacent deletions

    Tests simulation using a priority queue with lazy deletion and a linked list to repeatedly remove the smallest remaining element and its current neighbors.

    Heaps, Sorting & Searchheaplinked-listsimulationlazy-deletion
  • Data Structure DesignMediumAuto-graded
    Filter Stream Events by Registered Patterns

    Tests inverted index design and set-based matching to efficiently find which registered word patterns are satisfied by incoming events.

    Data Structure Designhash-tablessetsinverted-index
  • Data Structure DesignMediumAuto-graded
    Frequency-Based Cache Eviction

    Build a cache that tracks access counts and evicts the least-used item, breaking ties by recency, all in constant time.

    Data Structure Designhash-mapdoubly-linked-listcachedesign
  • Dynamic ProgrammingMediumAuto-graded
    Minimize Payment Transfers to Balance Group Accounts

    Tests backtracking with memoization to find the smallest number of payments needed to settle net balances across multiple participants.

    Dynamic Programmingbacktrackingmemoizationcombinatorial-search
  • SQL & DataMediumAuto-graded
    Daily Campaign Performance Summary Over a Rolling Window

    Tests conditional aggregation across multiple related tables, time-window filtering, fan-out avoidance, and safe division when computing per-day engagement rates.

    SQL & Dataaggregationjoindata-manipulation
  • Data Structure DesignMediumAuto-graded
    Score Tracker with Ranking and Top-K Queries

    Tests the ability to maintain ordered scores with efficient updates and rank lookups using augmented balanced search trees.

    Data Structure Designbinary-search-treeorder-statisticsdata-structures
  • Data Structure DesignMediumAuto-graded
    Versioned Key-Value Log with Point-in-Time Reads

    Tests per-key version tracking and efficient predecessor search to retrieve the most recent value written at or before any queried timestamp.

    Data Structure Designbinary searchhash mapversioning
  • Dynamic ProgrammingHardAuto-graded
    Expected Steps to Deplete Whole Pills from a Random Draw Process

    Tests modeling a stochastic process as a Markov chain and solving it with dynamic programming using conditional expectation.

    Dynamic Programmingprobabilityexpectationmarkov-chainrecurrence
  • Data Structure DesignMediumAuto-graded
    Access-Tracked Key-Value Store

    Build a dictionary that counts how many times each key has been retrieved, testing hash map design and state management.

    Data Structure Designhash-mapdesignsimulation
  • Arrays & HashingMediumAuto-graded
    Instrument-Based Estimator for a Randomized Encouragement Trial

    Tests whether a candidate can implement ITT, first-stage, and IV/Wald (LATE) estimators from a randomized encouragement design, including a balance check on pre-treatment activity.

    Arrays & Hashingcausal-inferencea-b-testinginstrumental-variables
  • Data Structure DesignMediumAuto-graded
    Round-Robin Load Balancer with Capacity and Shutdown

    Tests stateful system simulation with round-robin target selection, connection lifecycle tracking, capacity enforcement, and target shutdown with eviction ordering.

    Data Structure Designsimulationhash-tableround-robinstateful
  • Data Structure DesignMediumAuto-graded
    Disjoint Set: Merge Nodes and Query Connectivity

    Tests ability to implement Union-Find with union by rank and path compression, supporting merge, connectivity, and component-count queries.

    Data Structure Designunion-finddisjoint-setgraphdata-structure-design
  • Arrays & HashingMediumAuto-graded
    Deduplicate Coordinate List with Index Mapping

    Tests the ability to extract distinct elements while preserving first-occurrence order and building an index array for reconstruction.

    Arrays & Hashinghashingdeduplicationindexing
  • Trees & GraphsMediumAuto-graded
    Place One Beacon to Minimize Peak Shadow Distance

    Tests binary search on a monotone feasibility predicate combined with multi-source BFS and Chebyshev distance geometry on a 2-D grid.

    Trees & Graphsbfsbinary-searchgrid
  • Trees & GraphsMediumAuto-graded
    Recursive Region Tree and Safe Graph Nodes

    Tests recursive spatial subdivision (quadtree construction) and graph cycle detection (identifying nodes that always terminate).

    Trees & Graphsrecursiongraphsdivide-and-conquertopological-sort