KatInterview

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

Interview Practice Problems

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

5972
Problems
2212
Auto-graded
15
Topics
273
Added today

Showing 2101–2130 of 2212 results

  • Greedy & IntervalsMediumAuto-graded
    Consolidate Half-Open Interval Ranges

    Tests interval merging with half-open semantics, distinguishing overlap from adjacency, and handling nested ranges correctly.

    Greedy & Intervalsintervalssortinggreedyarray-manipulation
  • Greedy & IntervalsHardAuto-graded
    Minimum Guards to Cover All Museum Gallery Segments

    Tests ability to apply a sweep-line with a greedy exchange argument to optimally place point guards that each cover a fixed-radius interval on a 1-D gallery.

    Greedy & Intervalsgreedyintervalssweep line
  • Dynamic ProgrammingMediumAuto-graded
    Minimum Tokens to Reach a Score: Reusable vs. One-Time Use

    Tests whether a candidate can implement both unbounded and 0/1 knapsack DP to find the smallest number of tokens that sum exactly to a target.

    Dynamic Programmingdynamic-programmingknapsackbottom-up-dp
  • Stacks & QueuesMediumAuto-graded
    Minimum Length Subarray with Sum Threshold

    Tests the ability to optimize subarray sum queries using prefix sums and monotonic deque when values can be negative.

    Stacks & Queuesprefix-sumsmonotonic-dequesliding-windowarray
  • Data Structure DesignMediumAuto-graded
    Aggregate Scores Across a Sponsorship Tree

    Tests tree traversal and subtree aggregation by computing cumulative scores bottom-up across a forest of sponsor-recruit relationships.

    Data Structure Designtrees-graphsdesign-dsstacks-queues
  • Greedy & IntervalsMediumAuto-graded
    Assign Tasks to Time Slots with Minimum Idle Penalty

    Tests the exchange-argument greedy technique by scheduling deadline-bearing tasks into time slots to minimize total weighted idle (missed-deadline) penalty.

    Greedy & Intervalsgreedyintervalsschedulingexchange argument
  • Arrays & HashingEasyAuto-graded
    Complete the Run: Find the Gap in a Five-Card Sequence

    Tests ability to handle encoded card ranks, Ace-as-low/high semantics, ambiguous endpoints, and missing-element logic in a fixed consecutive sequence.

    Arrays & Hashingarraysstringsenumeration
  • SQL & DataHardAuto-graded
    Compute Per-Category Running Revenue with Reset on Loss

    Tests ability to implement window-style running totals that accumulate per category but reset to zero whenever a loss (negative value) would pull the running total below zero.

    SQL & Datawindow functionsrunning totalsdata cleaningsimulation
  • Trees & GraphsMediumAuto-graded
    Connected Land Regions in a Character Matrix

    Tests graph traversal and connected-component identification on a 2D grid using flood-fill techniques.

    Trees & Graphsgraph-traversaldfsconnected-componentsgrid
  • Dynamic ProgrammingEasyAuto-graded
    Count Paths Through a Grid with Blocked Cells

    Tests whether a candidate can apply bottom-up DP on a 2-D grid to count reachable paths from top-left to bottom-right while respecting blocked cells.

    Dynamic Programmingdynamic programminggridpaths
  • StringsMediumAuto-graded
    Decode a Run-Length Encoded String With Nested Groups

    Tests the ability to parse and expand a run-length encoded string that contains arbitrarily nested bracket groups, combining stack-based parsing with string manipulation.

    Stringsstringsparsingstackrun-length encoding
  • Trees & GraphsMediumAuto-graded
    Detect Circular Dependencies in a Build System

    Tests cycle detection in a directed graph by determining which packages in a build dependency graph are part of a circular dependency chain.

    Trees & Graphsgraphscycle detectionDFStopological sort
  • Stacks & QueuesEasyAuto-graded
    Evaluate Simple Arithmetic String Expressions

    Tests ability to evaluate a string expression containing non-negative integers, +, -, *, / operators, and parentheses using a stack-based approach.

    Stacks & Queuesstacksexpression evaluationparsing
  • Dynamic ProgrammingHardAuto-graded
    Find Minimum Cost to Multiply a Chain of Matrices

    Tests dynamic programming on interval optimization, optimal substructure, and avoiding greedy pitfalls in matrix multiplication ordering.

    Dynamic Programmingdynamic-programmingoptimizationrecursion
  • Linked ListsMediumAuto-graded
    Find the Duplicate and Cycle Length in a Functional Graph

    Tests cycle detection on an index-as-next-pointer array to find the single duplicate value and the length of the cycle it creates.

    Linked Listslinked listscycle detectionFloyd's algorithm
  • Arrays & HashingEasyAuto-graded
    Find the First Character Appearing Exactly Once

    Tests the ability to use hash counting (frequency maps) to efficiently locate the first character in a string that appears exactly once.

    Arrays & Hashingarrays & hashinghash countingstrings
  • Arrays & HashingEasyAuto-graded
    Find the Most Frequent Character Difference

    Tests whether a candidate can use hash counting to find the pair of distinct characters whose absolute frequency difference is largest in a given string.

    Arrays & Hashingarrays & hashinghash countingstrings
  • Linked ListsMediumAuto-graded
    Interleave Two Halves of a Linked List (Array Form)

    Tests pointer-manipulation thinking by reordering a node list so that the first half and reversed second half are interleaved, all represented as arrays of values.

    Linked Listslinked listtwo pointersarray manipulation
  • Arrays & HashingEasyAuto-graded
    Longest Subarray with Sum At Most K

    Tests the ability to apply a sliding window to find the longest contiguous subarray whose element sum does not exceed a given limit.

    Arrays & Hashingarrayssliding windowprefix sums
  • Greedy & IntervalsMediumAuto-graded
    Maximize Completed Jobs with Deadlines

    Tests greedy scheduling with deadlines: select and order unit-length jobs to maximize total profit, applying an exchange argument to prove optimality.

    Greedy & Intervalsgreedyschedulingsorting
  • Greedy & IntervalsMediumAuto-graded
    Maximum Simultaneous Room Bookings

    Tests the sweep line technique on interval scheduling to find the peak number of overlapping room bookings over a timeline.

    Greedy & Intervalssweep lineintervalsgreedy
  • Linked ListsMediumAuto-graded
    Merge K Sorted Linked-List Runs Into One

    Tests pointer manipulation by merging k sorted singly-linked-list segments (given as flat lists with run boundaries) into a single sorted list without allocating extra nodes.

    Linked Listslinked listsmergesortingpointer manipulation
  • Heaps, Sorting & SearchMediumAuto-graded
    Minimize Maximum Delivery Time Across Warehouses

    Tests binary search on the answer to find the minimum possible maximum delivery time when assigning shipments to warehouses with limited daily capacity.

    Heaps, Sorting & Searchbinary searchgreedysorting
  • Greedy & IntervalsMediumAuto-graded
    Minimize Maximum Job Lateness with Deadlines

    Tests the classic exchange-argument greedy insight: scheduling jobs by earliest deadline minimizes the maximum lateness over all jobs.

    Greedy & Intervalsgreedyintervalssortingexchange-argument
  • Trees & GraphsMediumAuto-graded
    Minimum Build Phases for a Software Dependency Graph

    Tests whether a candidate can apply topological ordering (Kahn's algorithm / BFS layer-by-layer) to schedule tasks into the fewest sequential build phases.

    Trees & Graphsgraphstopological sortBFSDAG
  • Dynamic ProgrammingHardAuto-graded
    Minimum Cost to Merge Stone Piles

    Tests interval DP by finding the minimum total cost to merge an array of stone piles into one, where merging any contiguous segment costs the sum of that segment.

    Dynamic Programmingdynamic programminginterval DPmemoization
  • Dynamic ProgrammingEasyAuto-graded
    Minimum Cost to Type a String on a Circular Keyboard

    Tests string DP by computing the minimum total movement cost to type a target string on a circular letter wheel, starting from a given letter.

    Dynamic Programmingdynamic programmingstring DPgreedy
  • Arrays & HashingHardAuto-graded
    Minimum Window Containing All Balanced Bracket Types

    Tests ability to use hash counting with a sliding window to find the shortest contiguous subarray that contains at least k complete pairs of each bracket type.

    Arrays & Hashingarrayshash mapsliding windowtwo pointers
  • Stacks & QueuesEasyAuto-graded
    Next Warmer Day in a Temperature Log

    Tests the ability to use a monotonic stack to efficiently find, for each day, how many days until a strictly warmer temperature is recorded.

    Stacks & Queuesstackmonotonic stackarray
  • StringsEasyAuto-graded
    Parse and Evaluate Simple Arithmetic Tokens

    Tests the ability to tokenize a raw arithmetic string into numbers and operators, then evaluate left-to-right respecting only + and - operations.

    Stringsstringstokenizingparsing