KatInterview

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

Coding Interview Problems

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

6002
Problems
2223
Auto-graded
15
Topics
273
Added today

Showing 1591–1620 of 2123 results

  • Data Structure DesignMediumAuto-graded
    Circular Buffer Deque with Auto-Resize

    Tests ability to build a double-ended queue on a ring-indexed array that doubles in capacity when full, keeping all operations amortized O(1).

    Data Structure Designdequecircular-arrayamortized-analysis
  • Linked ListsMediumAuto-graded
    Ordered Stage Queue: Simulate Item Promotion and Demotion

    Tests whether a candidate can model item movement across ordered stages using a normalized O(1)-per-move doubly linked list structure.

    Linked Listslinked-listsimulationdesign
  • Trees & GraphsMediumAuto-graded
    Lexicographic Topological Sort of a Task Graph

    Tests directed graph construction, cycle detection via Kahn's algorithm, and deterministic tie-breaking with a min-heap to produce the lexicographically smallest valid ordering.

    Trees & Graphstopological-sortgraphsheaps
  • Stacks & QueuesEasyAuto-graded
    Validate Nested Chemical Formula Brackets

    Tests bracket matching with domain-specific pairing rules where round, square, and curly brackets each have distinct valid nesting constraints.

    Stacks & Queuesstacksbracket matchingsimulationstrings
  • Heaps, Sorting & SearchMediumAuto-graded
    Busiest Conference Room Tracker

    Tests the ability to simulate event scheduling with delayed assignments using two priority queues to track which resource handles the most requests.

    Heaps, Sorting & Searchheapsimulationgreedypriority-queue
  • Trees & GraphsMediumAuto-graded
    Count Landlocked Islands

    Tests connected-component detection in grids with boundary constraints using BFS or DFS traversal.

    Trees & Graphsbfsdfsconnected-componentsgrid-traversal
  • Greedy & IntervalsMediumAuto-graded
    Consolidate Overlapping Ranges

    Tests interval merging logic, correctly handling touching boundaries, nested ranges, and producing sorted disjoint output.

    Greedy & Intervalsintervalssortinggreedy
  • Arrays & HashingMediumAuto-graded
    Rotate a Square Matrix 90° Clockwise In Place

    Tests whether a candidate can transform an n×n grid in place using transpose and row-reversal, with no extra matrix allocated.

    Arrays & Hashingmatrixin-placetwo-pointer
  • Greedy & IntervalsMediumAuto-graded
    Fewest Irrigation Devices to Water a Linear Garden

    Tests greedy interval selection and the ability to handle coverage gaps in a linear range.

    Greedy & Intervalsgreedyintervalssorting
  • Arrays & HashingMediumAuto-graded
    Sample Size Calculator for Two-Proportion Z-Test

    Tests ability to implement statistical power calculations for comparing two binary outcome rates in experimental design.

    Arrays & Hashingexperimentationstatisticspower-analysis
  • Data Structure DesignMediumAuto-graded
    Build a Time-Aware Key-Value Store with Expiration Logic

    Tests data structure design, time-based expiration semantics, and clean handling of missing or stale entries in an in-memory cache.

    Data Structure Designhash-tabletime-simulationexpirationcache-design
  • Arrays & HashingMediumAuto-graded
    Rotation Distance: Sum Absolute Differences Across All Shifts

    Tests array rotation mechanics, computing position-wise absolute differences for every cyclic offset, and returning results in sorted order.

    Arrays & Hashingarraysrotationsorting
  • Trees & GraphsMediumAuto-graded
    Build a Visual Directory Tree from Nested Dictionary

    Tests recursion, dictionary traversal, and string formatting to produce an indented tree structure with box-drawing connectors.

    Trees & Graphsrecursiontree-traversalstringsformatting
  • Arrays & HashingMediumAuto-graded
    Contiguous Subarray Sum Count

    Tests prefix sum technique with hash maps to count subarrays matching a target sum in linear time

    Arrays & Hashingprefix-sumhash-mapsubarray
  • Greedy & IntervalsMediumAuto-graded
    Consecutive-Range Handoff Pairs for Interval Coverage

    Tests interval reasoning and efficient pairing: find all unordered listing pairs whose consecutive availability windows together cover a full date range.

    Greedy & Intervalsintervalsbinary-searchhashingsorting
  • Greedy & IntervalsMediumAuto-graded
    Track Segment Coverage by Expanding Intervals

    Tests interval merging and coverage detection with streaming data updates.

    Greedy & Intervalsintervalsmerge-intervalsdata-structuresstreaming
  • Heaps, Sorting & SearchMediumAuto-graded
    Top-K Price Harvest from Tiered Stock Levels

    Tests whether a candidate can reformulate a greedy revenue problem into summing the largest elements across union-of-range price sets and implement an O(n log n) layer-sweep solution.

    Heaps, Sorting & Searchgreedysortingmath
  • Data Structure DesignMediumAuto-graded
    Digit Hand Showdown

    Classify numeric hands by frequency patterns with custom ranking, then break ties using positional comparison without sorting.

    Data Structure Designobject-oriented-designpattern-matchingextensibility
  • StringsHardAuto-graded
    Group Anagram Chains by Transformation Distance

    Tests anagram grouping combined with string parsing and multi-key sorting to build and rank clusters of anagrammatically related words from a structured input.

    Stringsstringsanagram groupingsortingparsing
  • Dynamic ProgrammingMediumAuto-graded
    Maximum Profit Under Capacity Constraint

    Tests understanding of 0/1 knapsack disguised by a misleading ordering constraint that is actually always satisfiable.

    Dynamic Programmingknapsackdynamic-programminggreedy
  • Dynamic ProgrammingMediumAuto-graded
    Partition Items Into Bins With Limited Capacity

    Tests the classic bounded knapsack variant where you must determine the minimum number of identical bins needed so each bin's total weight stays within a capacity, using DP to check feasibility.

    Dynamic Programmingdynamic programmingknapsackmemoization
  • Data Structure DesignMediumAuto-graded
    Session Key Manager with Deferred Cleanup

    Tests building a session-key store with TTL-based lazy eviction using a hash map and min-heap to process a sequence of operations.

    Data Structure Designheaphash-maplazy-deletionsimulation
  • Data Structure DesignMediumAuto-graded
    Find Unreceived IDs in a Sequential Stream

    Tests efficient gap tracking in a sequential ID space using sets and amortized range updates.

    Data Structure Designsetrange-trackingamortized-analysis
  • Arrays & HashingMediumAuto-graded
    Identify All Projects with Maximum Team Size

    Group assignment pairs by project, count members per project, and return every project tied for the largest team.

    Arrays & Hashingarrayshashinggroupingcounting
  • Arrays & HashingMediumAuto-graded
    Minimum Operations to Equalize Array by Selective Increments

    Tests insight that incrementing all-but-one is equivalent to decrementing one, leading to a sum-based formula instead of simulation.

    Arrays & Hashingmatharraysgreedy
  • Trees & GraphsHardAuto-graded
    Prune All Leaves Matching a Value, Cascading Upward

    Tests whether a candidate can use post-order traversal to handle cascading leaf deletions in a binary tree encoded as a level-order list.

    Trees & Graphsbinary-treepost-order-traversalrecursiontree-serialization
  • Heaps, Sorting & SearchMediumAuto-graded
    K Nearest Points to Origin

    Tests heap-based selection and distance computation to efficiently find the k points closest to the origin in 2D space.

    Heaps, Sorting & Searchheapdistanceselectionoptimization
  • Data Structure DesignMediumAuto-graded
    Binary Layout Manager with Dynamic Field Insertion

    Tests ability to maintain ordered sequences with efficient prefix-sum queries and positional insertions using balanced tree structures.

    Data Structure Designbinary-search-treeprefix-sumdata-structure-design
  • Trees & GraphsMediumAuto-graded
    Subtree Erasure in an Array-Backed Binary Tree

    Tests implicit heap-tree traversal, subtree identification via index arithmetic, and stable compaction without mutating the input array.

    Trees & Graphstrees-graphsarraysbfs-dfs
  • Arrays & HashingEasyAuto-graded
    Best-of-Five: Probability All Five Games Are Played

    Tests whether a candidate can derive the closed-form probability that a best-of-five series requires all five games, using combinatorial reasoning.

    Arrays & Hashingprobabilitycombinatoricsmath