KatInterview

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

Coding Interview Problems

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

6008
Problems
2226
Auto-graded
15
Topics
273
Added today

Showing 1501–1530 of 2126 results

  • Heaps, Sorting & SearchHardAuto-graded
    Nearest Profiles by Masked Mean Squared Error

    Tests pairwise distance computation with a missing-data-aware MSE metric, tie-breaking, and top-K ranking across user profiles.

    Heaps, Sorting & Searchsortingsimilaritymissing-data
  • Heaps, Sorting & SearchMediumAuto-graded
    Minimum Cost to Combine All Elements

    Tests greedy algorithm design and min-heap operations to repeatedly merge pairs optimally.

    Heaps, Sorting & Searchheapgreedypriority-queue
  • Trees & GraphsHardAuto-graded
    Filter Hierarchical Records by Ancestor Validity

    Tests memoized path traversal in a parent-pointer hierarchy with cycle detection and ancestral filtering rules.

    Trees & Graphsgraphsmemoizationcycle-detection
  • Data Structure DesignMediumAuto-graded
    Word Dictionary with Insert and Query Operations

    Tests implementing a character-level trie to handle insert, exact-match lookup, and prefix-existence queries while distinguishing complete words from prefixes.

    Data Structure Designtriedata-structuresstring-matching
  • Arrays & HashingHardAuto-graded
    Minimum Window Containing All K Most-Frequent Characters

    Tests ability to combine hash-counting (frequency maps) with a sliding window to find the shortest contiguous subarray satisfying a dynamic frequency-based constraint.

    Arrays & Hashingarrayshash mapsliding windowfrequency counting
  • StringsMediumAuto-graded
    Group Words by Character Frequency

    Tests hash map construction with canonical keys to partition strings by anagram equivalence

    Stringshash-mapsortingstring-manipulation
  • Dynamic ProgrammingMediumAuto-graded
    Prime-Step Path Score + Bottleneck Throughput Boost

    Tests DP over prime-length jumps on an array and binary search on a "maximize the minimum" pipeline scaling problem, combined into one function.

    Dynamic Programmingdynamic-programmingbinary-searchnumber-theory
  • Arrays & HashingMediumAuto-graded
    Contiguous Subarray with Sum Divisible by K

    Tests whether a candidate can apply prefix-sum modular arithmetic to detect a length-≥2 subarray whose sum divides evenly by k in linear time.

    Arrays & Hashingprefix-sumhash-mapmodular-arithmetic
  • Data Structure DesignHardAuto-graded
    In-Memory Cell Grid with Formula Chaining

    Tests dependency graph design, lazy cache invalidation, recursive formula evaluation, and cycle detection in a grid of named cells.

    Data Structure Designdesigngraphssimulation
  • Data Structure DesignMediumAuto-graded
    Sliding-Window Traffic Throttle with Dual Limit Rules

    Tests sliding-window counting over timestamped event logs using per-source and per-source-destination deque-based rate limiting.

    Data Structure Designsliding-windowdequehash-mapsimulation
  • Stacks & QueuesMediumAuto-graded
    Cascade Removal of Equal Neighbor Groups

    Tests stack-based simulation of iterative removals that trigger chain reactions when fragments recombine.

    Stacks & Queuesstackstringsimulation
  • Math & Bit ManipulationEasyAuto-graded
    Calculate QR Campaign Funnel Metrics

    Tests understanding of multi-stage conversion funnels by computing metrics at each step given input rates.

    Math & Bit Manipulationmathfunnel-analysisconversions
  • Arrays & HashingMediumAuto-graded
    Probability the Third Card Is an Ace After an Ace Appears

    Compute a conditional probability for drawing three cards without replacement by splitting on how many aces the first two draws contain.

    Arrays & Hashingprobabilityconditional-probabilitycountingcombinatorics
  • Arrays & HashingMediumAuto-graded
    Clockwise Rotation with Frozen Diagonals

    Simulate clockwise 90° rotation on a square grid while keeping all main-diagonal and anti-diagonal elements fixed in place.

    Arrays & Hashingmatrixsimulationrotation
  • Data Structure DesignMediumAuto-graded
    Four-Card Hand Ranker with Extensible Type System

    Tests object-oriented design skills by building a modular, open/closed hand classifier and comparator for a custom four-card game.

    Data Structure Designoopdesignsimulation
  • Linked ListsMediumAuto-graded
    Detect Functional-Graph Cycle Start on an Index Array

    Tests cycle detection (Floyd's or similar) on an implicit linked list encoded as a next-pointer array, requiring the candidate to find where the cycle begins.

    Linked Listslinked listscycle detectiontwo pointersFloyd's algorithm
  • Trees & GraphsMediumAuto-graded
    Answer Reachability Queries on an Undirected Graph

    Build connected components from an edge list with Union-Find, then answer many connectivity queries quickly.

    Trees & Graphsunion-findgraphdisjoint-setconnectivity
  • Trees & GraphsMediumAuto-graded
    Best Meeting Point Across All Stations in a City Grid

    Tests multi-source BFS on a grid to find the open cell with the smallest total shortest-path distance to every station, respecting walls and blocked cells.

    Trees & Graphsbfsgridshortest-path
  • Data Structure DesignMediumAuto-graded
    Mini Spreadsheet: Cell Formulas and Cycle Detection

    Tests dependency graph modeling, cycle detection on writes, and correct value propagation across a simple formula-based spreadsheet engine.

    Data Structure Designgraphsdfsdesign
  • Heaps, Sorting & SearchMediumAuto-graded
    Collapse Repeat Visits and Order the Result

    Tests array manipulation, hash-based deduplication, and implementing an O(n log n) sort from scratch without relying on built-in sort utilities.

    Heaps, Sorting & Searcharrayssortinghashingheapsort
  • Dynamic ProgrammingMediumAuto-graded
    Find Maximum Strictly Ascending Subsequence Length

    Tests dynamic programming optimization using binary search to efficiently compute the longest strictly increasing subsequence in O(n log n) time.

    Dynamic Programmingbinary-searchsubsequencesgreedy
  • Dynamic ProgrammingMediumAuto-graded
    Ways to Decode a Numeric String into Letters

    Tests dynamic programming reasoning on sequential digit-to-letter mappings, including careful handling of zeros and invalid two-digit pairs.

    Dynamic Programmingdynamic-programmingstringsrecursion
  • Trees & GraphsMediumAuto-graded
    Longest Path in an Undirected Tree

    Tests whether a candidate can find the longest edge-path in a tree using two linear-time traversals and reason about why the approach is correct.

    Trees & Graphsbfstreesgraph-traversal
  • StringsMediumAuto-graded
    Longest Window of Unique Characters

    Tests whether a candidate can apply a sliding window with a character index map to find the longest contiguous run of non-repeating characters.

    Stringssliding-windowhash-maptwo-pointers
  • StringsMediumAuto-graded
    Total Palindrome Substring Count

    Tests the ability to efficiently enumerate all palindromic substrings using center expansion and handle both odd and even-length cases.

    Stringspalindromestwo-pointersstring-manipulation
  • StringsMediumAuto-graded
    Reconcile Payments with Invoices Using Memo and Amount

    Tests multi-pattern substring search, hash-based indexing, and greedy reconciliation with priority-based tie-breaking across two matching strategies.

    Stringsstring-matchinghash-mapgreedyaho-corasick
  • Math & Bit ManipulationHardAuto-graded
    Compute Complexity Bounds for Dense Matrix Operations

    Tests asymptotic analysis skills by deriving time and space complexity for dense matrix multiplication with multiple dimensions.

    Math & Bit Manipulationcomplexity-analysislinear-algebrabig-o
  • Trees & GraphsMediumAuto-graded
    Fewest Cells Through a Diagonal-Move Grid

    Find the length of the shortest 8-directional clean-cell path across a square 0/1 grid using BFS.

    Trees & Graphsbfsgridshortest-path
  • Data Structure DesignMediumAuto-graded
    Shared Token Bucket with Optimistic Concurrency

    Tests implementation of a token bucket rate limiter over a versioned key-value store, including lazy replenishment, clock skew tolerance, and CAS-based retry logic.

    Data Structure Designdesignconcurrencysimulation
  • Greedy & IntervalsMediumAuto-graded
    Maximum Non-Overlapping Meetings in a Workday

    Tests greedy interval scheduling and string parsing: convert "Name: HH:MM-HH:MM" strings into time intervals, then find the largest set of compatible meetings.

    Greedy & Intervalsgreedyintervalsstrings