KatInterview

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

Coding Interview Problems

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

5971
Problems
2211
Auto-graded
15
Topics
272
Added today

Showing 2671–2700 of 2761 results

  • 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
  • Arrays & HashingMediumAuto-graded
    Partition Array by Parity of Frequency

    Tests in-place partitioning using a hash map to precompute element frequencies, then a two-pointer scheme to rearrange elements without extra array allocation.

    Arrays & Hashingarrayshash mapstwo pointersin-place partitioning
  • Arrays & HashingMediumAuto-graded
    Partition Array Into Alternating Parity Groups

    Tests in-place partitioning by rearranging an integer array so all even-indexed positions hold even numbers and all odd-indexed positions hold odd numbers, without allocating a new array.

    Arrays & Hashingarraystwo pointersin-place partitioning
  • StringsMediumAuto-graded
    Peak Occurrence Count of a Bounded Substring

    Tests whether a candidate can reduce a multi-length sliding-window problem to a single window size and efficiently track distinct-character counts.

    Stringssliding-windowhash-mapstrings
  • Stacks & QueuesEasyAuto-graded
    Print Queue Page Order Simulator

    Tests queue simulation by modeling a shared printer that interleaves multi-page jobs across rounds, returning the final page-output order.

    Stacks & Queuesqueuesimulationarrays
  • Stacks & QueuesHardAuto-graded
    Reconstruct Function Entry/Exit Events from Call Stack Snapshots

    Tests ability to compute positional diffs between consecutive call stack snapshots and emit correctly ordered START/END events using a stack-based mental model.

    Stacks & Queuesstacksimulationstring manipulation
  • Trees & GraphsMediumAuto-graded
    Schedule Dependent Tasks with Priority and Tag Exclusion

    Tests Kahn's algorithm with deterministic tie-breaking, urgency-based heap ordering, cycle detection with path reporting, and transparent skipping of tag-excluded tasks.

    Trees & Graphstopological-sortheapgraphs
  • Heaps, Sorting & SearchMediumAuto-graded
    Schedule Tasks by Deadline and Priority

    Tests the ability to sort a list of tasks using a multi-key custom comparator involving deadlines, priorities, and tie-breaking rules.

    Heaps, Sorting & Searchsortingcustom sort keysheaps
  • StringsEasyAuto-graded
    Shortest Palindromic Superstring by Suffix–Prefix Overlap

    Tests understanding of palindromic structure by finding the minimum characters to append to a string to make the whole string a palindrome.

    Stringsstringspalindrometwo pointers
  • StringsMediumAuto-graded
    Shortest Substring Containing All Required Characters

    Tests the sliding window pattern with frequency counting to find the shortest substring of one string that covers every character (with multiplicity) of another.

    Stringssliding-windowhash-maptwo-pointers
  • Stacks & QueuesHardAuto-graded
    Simulate a Multi-Lane Toll Plaza Queue

    Tests queue simulation skills by modeling vehicles routing through toll lanes with dynamic overflow and lane-closing logic.

    Stacks & Queuesqueuesimulationgreedy
  • Data Structure DesignMediumAuto-graded
    Sliding-Window Rate Limiter Over Event Timestamps

    Tests the ability to implement a sliding-window rate limiter that, given a log of request timestamps, determines which requests are allowed under a fixed-window capacity.

    Data Structure Designdata structuresrate limitersliding window
  • Data Structure DesignHardAuto-graded
    Stateful Activity Window Aggregation Over an Event Stream

    Tests whether a candidate can maintain per-user rolling time windows over a chronologically ordered stream and emit aggregated records incrementally without buffering the whole input.

    Data Structure Designhash-mapsimulationstreamingaggregation
  • Trees & GraphsMediumAuto-graded
    Sum of Decimal Paths in a Binary Tree

    Tests depth-first (or breadth-first) traversal of a binary tree while tracking the accumulated digit value along each root-to-leaf path.

    Trees & Graphsbinary-treebfsdfs
  • Math & Bit ManipulationMediumAuto-graded
    Sum of Digits Across All Bases from 2 to K

    Tests ability to repeatedly convert an integer into multiple bases and accumulate digit sums, combining base-conversion mechanics with modular arithmetic.

    Math & Bit Manipulationmathbit manipulationbase conversion