KatInterview

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

Coding Interview Problems

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

5978
Problems
2214
Auto-graded
15
Topics
272
Added today

Showing 1981–2010 of 2114 results

  • Heaps, Sorting & SearchMediumAuto-graded
    Locate the Transition Point in a Monotonic Boolean Array

    Identify the earliest index where a boolean array transitions from False to True, testing binary search on boundaries and edge cases.

    Heaps, Sorting & Searchbinary-searcharraysboundaries
  • Trees & GraphsMediumAuto-graded
    Maximum Path Gain in a Weighted Tree

    Tests tree DP on a weighted tree to find the maximum sum of node values along any root-to-leaf path, using depth-first traversal and subproblem combination.

    Trees & Graphstreesdynamic programmingdepth-first search
  • Arrays & HashingMediumAuto-graded
    Validate Partially Filled Sudoku Grid

    Tests ability to check constraint satisfaction across multiple overlapping groups using efficient duplicate detection.

    Arrays & Hashinghash-setconstraint-checkingmatrix
  • Data Structure DesignMediumAuto-graded
    Incremental Config Value Store with Dependency Tracking

    Tests ability to build a stateful key-value store that resolves integer expressions with named references, propagates updates through a dependency graph, and rejects cycles.

    Data Structure Designgraphtopological-sortdesign
  • Math & Bit ManipulationEasyAuto-graded
    Count Subsets With Product Equal to a Power of Two

    Tests whether candidates can combine combinatorics (counting subsets) with the insight that a product is a power of two iff every element is itself a power of two.

    Math & Bit Manipulationcombinatoricsbit manipulationmath
  • Heaps, Sorting & SearchMediumAuto-graded
    Sort Competitors by Vote Position Counts

    Tests multi-criteria sorting with position-based vote counting and lexicographic tiebreaking.

    Heaps, Sorting & Searchsortingcustom-comparatorcounting
  • Math & Bit ManipulationMediumAuto-graded
    Expected Flips for Random Walkers to Collide on Octagon

    Tests Markov chain modeling, symmetry reduction, and first-step recurrence equations for a two-particle random walk problem.

    Math & Bit Manipulationprobabilitymarkov-chainsrandom-walksexpected-value
  • Arrays & HashingMediumAuto-graded
    Calculate Upper-Tail Probability for Binomial Distribution

    Compute the exact cumulative probability P(X ≥ k) for a binomial random variable, testing understanding of numerical stability in probability calculations.

    Arrays & Hashingprobabilitybinomial-distributionnumerical-methods
  • Stacks & QueuesMediumAuto-graded
    Reconstruct Call Events from Profiler Snapshots

    Tests stack trace interpretation, event inference from sparse data, and algorithmic reasoning about nesting and correctness.

    Stacks & Queuesstacksalgorithmsdata-structures
  • StringsMediumAuto-graded
    First Unique Character and Highest Class Average

    Tests hash-based frequency counting for strings and grouped numeric aggregation with exact average comparison.

    Stringshash-mapstring-manipulationaggregation
  • Dynamic ProgrammingMediumAuto-graded
    Select Numbers to Maximize Score with Neighbor Elimination

    Tests dynamic programming on sparse integers and hash map frequency counting to find the optimal subset when adjacent values conflict.

    Dynamic Programminghash-mapsortinghouse-robber-variant
  • Data Structure DesignMediumAuto-graded
    Aggregated Multi-Venue Liquidity Tracker with BBO and NBBO

    Build a system that maintains liquidity across trading venues and efficiently queries best prices per venue and across all venues.

    Data Structure Designheapsdata-structureslazy-deletion
  • Dynamic ProgrammingMediumAuto-graded
    Maximum Length of Mirror Subsequence

    Tests dynamic programming on strings to find the longest subsequence that is identical when reversed.

    Dynamic Programmingdynamic-programmingstringssubsequences
  • Arrays & HashingHardAuto-graded
    Bayesian A/B Test Launch Decision with Cost Tradeoffs

    Tests whether a candidate can combine Bayesian posterior updating with expected-value analysis to make a statistically grounded product launch decision.

    Arrays & Hashingbayesian-inferencedecision-analysisab-testing
  • Arrays & HashingMediumAuto-graded
    Peak Subarray, Lone Value, and Spiral Grid Traversal

    Tests Kadane's algorithm with tie-breaking, frequency-based minimum selection, and counterclockwise skip-step grid simulation in one combined function.

    Arrays & Hashingarraysdynamic-programmingsimulation
  • Greedy & IntervalsMediumAuto-graded
    Budget-Constrained Round-Trip Selection

    Tests greedy selection and sorting to maximize items within a budget while minimizing cost for that maximum count.

    Greedy & Intervalsgreedysortingarrays
  • Arrays & HashingEasyAuto-graded
    Correcting Sampling Bias When Counting Children Per Household

    Tests whether a candidate can identify and reverse length-biased sampling to recover true household-level proportions from child-level survey data.

    Arrays & Hashingprobabilitysampling-biasweighted-estimation
  • Math & Bit ManipulationMediumAuto-graded
    Smallest Integer Divisible by All Segment Lengths

    Tests the ability to apply LCM iteratively and use GCD to reduce it, while reasoning about arithmetic progressions and large-number arithmetic.

    Math & Bit Manipulationmathnumber-theorygcd-lcm
  • Arrays & HashingMediumAuto-graded
    Coffee Quality Comparison Probability

    Calculate the probability that one person's coffee selections outperform another's under different definitions of "better"

    Arrays & Hashingprobabilitycombinatoricssymmetry
  • Data Structure DesignMediumAuto-graded
    Track Click-to-Conversion Matching with Time Windows

    Tests event stream processing with time-based lookback windows, requiring efficient per-user state management and timestamp-based expiration logic.

    Data Structure Designqueueshash-mapstime-windows
  • Trees & GraphsMediumAuto-graded
    Detect a Cycle in a Directed Course Prerequisite Graph

    Tests whether you can model dependency constraints as a directed graph and use topological sort to detect cycles that make all tasks impossible to complete.

    Trees & Graphstopological-sortgraphcycle-detection
  • StringsHardAuto-graded
    Greedy Token Substitution with Longest Prefix Matching

    Tests prefix-tree construction, greedy string scanning, and longest-match selection for token-based text transformation.

    Stringstriegreedystring-processing
  • Data Structure DesignMediumAuto-graded
    Transaction Fraud Pipeline with Behavioral Rules

    Build a stateful stream processor that validates payment records, detects velocity and spending anomalies, and produces fixed-width audit logs.

    Data Structure Designsimulationparsingsliding-window
  • Data Structure DesignHardAuto-graded
    Banking Ledger with Time-Based Transfers and Account Consolidation

    Build an in-memory banking system that processes timed fund transfers deterministically and consolidates accounts with automatic transaction rerouting.

    Data Structure Designunion-findsimulationsorting
  • Trees & GraphsHardAuto-graded
    Combine Tree Structures with Ordered Name Matching

    Tests recursive tree traversal with order-sensitive child pairing by name occurrence and careful handling of unmatched nodes.

    Trees & Graphsrecursiontree-traversalhash-table
  • Greedy & IntervalsMediumAuto-graded
    Find Available Time Slots in a Repeating Weekly Schedule

    Tests interval merging with time zones, weekly recurrence, and range filtering to find deployable windows on a cyclic timeline.

    Greedy & Intervalsintervalsarraystime-zones
  • Dynamic ProgrammingMediumAuto-graded
    Minimum Cost to Transform One String into Another

    Tests string DP by computing the minimum total cost to convert a source string into a target string using per-character insert, delete, and replace operations with custom costs.

    Dynamic Programmingdynamic programmingstringedit distance
  • Linked ListsHardAuto-graded
    Interleave Linked List Halves by Node Values

    Tests pointer-manipulation intuition by reordering a linked list (given as an array) into a specific interleaved pattern derived from splitting and reversing halves.

    Linked Listslinked listsarray manipulationtwo pointers
  • Math & Bit ManipulationMediumAuto-graded
    Count Lattice Paths Through Required Checkpoints

    Tests whether a candidate can combine combinatorics (binomial coefficients) to count grid paths that must pass through a sequence of ordered checkpoints.

    Math & Bit Manipulationcombinatoricsmathdynamic programming
  • Data Structure DesignMediumAuto-graded
    Flip Isolated O Regions to X Using Union-Find

    Implement a union-find solution to identify and capture O regions that don't reach the board's edges, testing disjoint-set design and 2D-to-1D index mapping.

    Data Structure Designunion-finddisjoint-setgridconnectivity