KatInterview

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

Coding Interview Problems

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

6013
Problems
2228
Auto-graded
15
Topics
276
Added today

Showing 1441–1470 of 2127 results

  • Arrays & HashingMediumAuto-graded
    Find Most Common Elements Without Built-in Max

    Tests manual maximum-finding across a frequency dictionary, tie-breaking by first occurrence, and working with stringified keys.

    Arrays & Hashinghash-mapfrequency-countingiteration
  • Data Structure DesignHardAuto-graded
    Exact-Phrase Lookup Across a Document Collection

    Tests building a positional inverted index so that multi-word phrases can be found by exact word sequence across many documents with repeated queries handled efficiently.

    Data Structure Designinverted-indexstring-searchhashing
  • Dynamic ProgrammingHardAuto-graded
    Build Arithmetic Expressions That Hit a Target Value

    Tests backtracking with incremental precedence-aware evaluation to enumerate all +/* expressions over a number sequence that sum to a given target.

    Dynamic Programmingbacktrackingrecursionoperator-precedence
  • Trees & GraphsMediumAuto-graded
    Shortest Path from Multiple Sources in a Grid

    Tests understanding of multi-source BFS to efficiently compute shortest distances from any of several starting points to many query locations.

    Trees & Graphsbfsgraph-traversalshortest-pathgrid
  • Data Structure DesignMediumAuto-graded
    Hash-Tree Diff: Detect File Changes Between Two Snapshots

    Tests ability to build a bottom-up Merkle hash tree from file path/content mappings and use subtree hash pruning to efficiently classify added, modified, and deleted files.

    Data Structure Designhashingtrees-graphsrecursion
  • Trees & GraphsMediumAuto-graded
    Spot the VIP in a Social Network

    Tests whether a candidate can exploit a single elimination insight to find a universal acquaintance in O(n) time instead of O(n²).

    Trees & Graphsgraphseliminationtwo-pass
  • Arrays & HashingEasyAuto-graded
    Random Assignment Statistics with Replacement

    Compute expected allocation count, reachability probability, and expected coverage when distributing items randomly with replacement.

    Arrays & Hashingprobabilityexpectationbinomialcomplement-rule
  • StringsMediumAuto-graded
    Case-Insensitive Substring Search Across a Music Catalog

    Tests ability to normalize user input and apply multi-field substring filtering across a collection of structured records.

    Stringsstringsfilteringcase-insensitive
  • Dynamic ProgrammingMediumAuto-graded
    Pack Expedition Gear Within Weight and Volume Limits

    Tests the 2-constraint (weight + volume) knapsack variant using DP with memoization or tabulation to maximize the total utility of selected gear items.

    Dynamic Programmingdynamic programmingknapsackmemoization
  • Trees & GraphsMediumAuto-graded
    Minimum Travel Cost with Layover Limit

    Tests weighted shortest-path reasoning under a hard constraint on the number of edges traversed, requiring a round-bounded relaxation strategy.

    Trees & Graphsgraphsbellman-fordshortest-path
  • Trees & GraphsMediumAuto-graded
    Root-to-Leaf Sum Verification

    Tests depth-first traversal of a binary tree encoded as an indexed array to find paths matching a target sum.

    Trees & Graphsbinary-treedfsiterativepath-sum
  • Math & Bit ManipulationEasyAuto-graded
    Truth-Tellers and Liars: Deduce Two Island Identities

    Tests systematic logical deduction by resolving a two-person truth-teller/liar puzzle through exhaustive case analysis.

    Math & Bit Manipulationlogiccase-analysismath
  • Data Structure DesignMediumAuto-graded
    Simulate a Fixed-Capacity Circular Queue

    Tests ability to implement a circular buffer with O(1) enqueue/dequeue/peek and correct wraparound, full/empty handling, and ordered iteration.

    Data Structure Designcircular-bufferqueuearraysimulation
  • Arrays & HashingMediumAuto-graded
    Find Pair with Given Sum

    Tests the ability to use hash-based lookups for constant-time complement checking and handle input validation rigorously.

    Arrays & Hashinghash-tabletwo-pointersarray
  • Trees & GraphsMediumAuto-graded
    Grid Maze Shortest Path with A* Search

    Tests knowledge of informed graph search, admissible heuristics, priority-queue mechanics, and canonical path reconstruction on a 2-D grid.

    Trees & Graphsgraph-searcha-starbfsshortest-path
  • Greedy & IntervalsHardAuto-graded
    Maximize Profit from Weighted Deadline-Constrained Tasks

    Tests the classic weighted job scheduling with deadlines: greedily select a maximum-profit feasible subset of unit-length tasks, each with a deadline and profit, using a disjoint-set (union-find) structure for efficiency.

    Greedy & Intervalsgreedyschedulingunion-findintervals
  • StringsHardAuto-graded
    Sum Two Large Numbers Represented as Strings

    Tests whether a candidate can implement column-by-column addition with carry logic on digit strings, without converting the whole string to a native integer.

    Stringsstringsmath-bitssimulation
  • StringsEasyAuto-graded
    Process Sequential Variable Assignments

    Tests parsing and evaluating variable assignments in order, handling literals, references, and arithmetic expressions.

    Stringsparsingdictionaryexpression-evaluation
  • Trees & GraphsMediumAuto-graded
    Schedule Courses Given Prerequisites

    Tests directed graph modeling, cycle detection, and topological ordering using Kahn's algorithm or DFS.

    Trees & Graphstopological-sortgraphkahn-algorithmcycle-detection
  • Math & Bit ManipulationMediumAuto-graded
    Reroll Game Expected Value and Break-Even Cost

    Tests probability recursion, expected value with random stopping times, and cost-benefit analysis in a sequential game.

    Math & Bit Manipulationprobabilityexpected-valuerecursion
  • Data Structure DesignMediumAuto-graded
    Round-Robin Task Distribution with Dynamic Server Availability

    Tests stateful simulation with circular iteration, capacity tracking, and toggling availability flags.

    Data Structure Designsimulationcircular-iterationstate-management
  • Greedy & IntervalsHardAuto-graded
    Minimum Adjacent Swaps to Sort a Binary String

    Tests greedy inversion-counting on a binary string to find the minimum number of adjacent swaps needed to push all 1s to the right.

    Greedy & Intervalsgreedystringsinversion-count
  • Trees & GraphsMediumAuto-graded
    Compute Reporting Metrics in a Company Hierarchy

    Tests tree construction from parent pointers and post-order traversal to aggregate counts across nested organizational levels.

    Trees & Graphstreedfspost-orderrecursion
  • Arrays & HashingMediumAuto-graded
    Cluster Viewers by Recent Watch Set

    Tests dictionary grouping, set operations on list suffixes, and canonical key construction for equivalence classes.

    Arrays & Hashinghash-mapset-operationsgrouping
  • Data Structure DesignMediumAuto-graded
    Replay Operations Against an LRU Cache

    Replay a scripted sequence of get/put operations against a fixed-capacity LRU cache and return one result per operation.

    Data Structure Designlru-cachehash-mapsimulationordered-dict
  • Arrays & HashingMediumAuto-graded
    Verify Safe Spacing During Multi-Vehicle Forward Simulation

    Tests discrete-time physics simulation with kinematic updates and safety constraint checking across multiple moving objects.

    Arrays & Hashingsimulationphysicsiteration
  • Heaps, Sorting & SearchMediumAuto-graded
    Unique Element Count via Binary Search Jumps

    Count unique values in a sorted array by jumping between runs using binary search, achieving sublinear time when diversity is low.

    Heaps, Sorting & Searchbinary-searcharrayssorted-arrayoptimization
  • Arrays & HashingMediumAuto-graded
    Compute Spending Totals by Worker, Journey, and Type

    Tests efficient multi-key aggregation using hash maps to group and sum records in a single pass over large datasets.

    Arrays & Hashinghash-mapsaggregationgrouping
  • Trees & GraphsHardAuto-graded
    Safe Edge Insertion Check for a Dependency Graph

    Tests graph reachability and cycle detection: determine whether a new directed edge can be added to an acyclic dependency graph without introducing a cycle.

    Trees & Graphsgraphsdepth-first-searchcycle-detectionreachability
  • Heaps, Sorting & SearchMediumAuto-graded
    Task Scheduler with Parallel Workers

    Simulate dispatching sequential tasks to parallel workers and determine when all work completes.

    Heaps, Sorting & Searchheapsimulationgreedy