KatInterview

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

Coding Interview Problems

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

5974
Problems
2212
Auto-graded
15
Topics
269
Added today

Showing 2611–2640 of 2762 results

  • Trees & GraphsMediumModel answer
    Build a Same-Domain Web Page Crawler

    Write a crawler that visits all pages reachable from a start URL, staying within the same domain, avoiding cycles and duplicate fetches.

    Trees & Graphsgraph-traversalbfsdfsurl-parsing
  • Math & Bit ManipulationMediumAuto-graded
    Count Pairs Whose XOR Has Exactly K Set Bits

    Tests the ability to combine bit counting (popcount) with efficient pair enumeration to find pairs in an array whose XOR contains exactly K set bits.

    Math & Bit Manipulationbit manipulationnumber theorycombinatorics
  • Data Structure DesignMediumModel answer
    Wind Field Tracker for Hot Air Balloons

    Build a system that tracks balloon altitudes, computes spatially-varying wind exposure from multiple sources, and identifies stable balloons above a threshold.

    Data Structure Designevent-simulationspatial-aggregationtime-based-statedata-structures
  • Heaps, Sorting & SearchMediumAuto-graded
    Rank Tournament Leaders by Multi-Level Criteria

    Tests sorting and aggregation skills by computing tournament standings with points, goal difference, and goals scored as tie-breakers.

    Heaps, Sorting & Searchsortingsimulationaggregation
  • 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
  • Data Structure DesignMediumModel answer
    Build a Dynamic IP Address Filter with CIDR and Range Support

    Implement a low-latency IP rule matcher supporting CIDR blocks and numeric ranges with conflict resolution based on specificity and recency.

    Data Structure Designnetworkingdata-structuresheapsalgorithms
  • Trees & GraphsMediumModel answer
    Build a File Owner Aggregator for Code Review Assignment

    Parse Git diffs and a CSV ownership map to identify which contributor owns the most modified files in a branch comparison.

    Trees & Graphsgitfile-iocsvaggregation
  • 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
  • Data Structure DesignMediumModel answer
    Time-Ordered Credit Bucket Manager

    Build a ledger tracking credit buckets with expiration windows, supporting out-of-order events, priority-based consumption, and point-in-time balance queries.

    Data Structure Designheapsevent-orderingtime-seriesdata-structures
  • 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
  • Data Structure DesignMediumModel answer
    Managing a Live Event Stream with Pause and Statistics

    Build a React hook that processes a high-speed event stream with deduplication, sorting, memory limits, pause/resume, and rolling time-window metrics.

    Data Structure Designreacthooksstate-managementstreaming
  • Data Structure DesignMediumModel answer
    RPN Calculator and Lock-Free Queue Implementation

    Build a macro-enabled expression evaluator and implement a thread-safe ring buffer with proper memory ordering.

    Data Structure Designconcurrencymemory-managementcompilersdata-structures
  • Data Structure DesignMediumModel answer
    Build a Rule-Based Access Control Evaluator with Expression Parsing

    Design and implement an access decision engine that evaluates ordered security rules with conditions expressed in a custom expression language.

    Data Structure Designparsinginterpretersrecursioncompiler-design
  • 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
  • Arrays & HashingMediumModel answer
    Build an Annotation Assignment Schedule

    Construct a valid work schedule assigning human reviewers to tasks under minimum-coverage and no-repeat constraints, then extend it to stay balanced in every prefix.

    Arrays & Hashingconstructiveschedulingcombinatorics
  • 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