KatInterview

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

Interview Practice Problems

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

5987
Problems
2219
Auto-graded
15
Topics
270
Added today

Showing 1891–1920 of 2219 results

  • Trees & GraphsMediumAuto-graded
    Lowest Shared Ancestor in Organization Hierarchy

    Finding the deepest node that lies on the upward path to the root for all given employees in a tree structure.

    Trees & Graphstreelowest-common-ancestordepth-first-searchbreadth-first-search
  • Data Structure DesignHardAuto-graded
    Simulate a TTL-Aware LFU Cache with Frequency Snapshots

    Tests ability to simulate a multi-operation Least-Frequently-Used cache that evicts expired entries by TTL and breaks ties by recency, while supporting frequency-snapshot queries.

    Data Structure Designdata structurescachesimulation
  • Arrays & HashingHardAuto-graded
    Coin Flip Race: HHT vs HTH Probability and Conditional Wait

    Tests whether you can set up a Markov chain for a pattern race, derive absorption probabilities, and compute a conditional expected stopping time.

    Arrays & Hashingmarkov-chainsprobabilityexpected-value
  • Linked ListsMediumAuto-graded
    Interleave Two Linked Lists from Their Midpoints

    Tests pointer-manipulation reasoning by reordering a singly linked list (given as an array) so nodes alternate between the first and second halves, starting from their respective midpoints.

    Linked Listslinked liststwo pointersarray manipulation
  • Arrays & HashingMediumAuto-graded
    Multiply Two Matrices

    Tests understanding of matrix multiplication mechanics, nested iteration, and accumulation patterns.

    Arrays & Hashingmatrixnested-loopsmath
  • Heaps, Sorting & SearchMediumAuto-graded
    Minimum Bandwidth to Stream All Files Within Deadline

    Tests binary search on the answer to find the minimum integer bandwidth that allows streaming a list of files (each with a size and deadline) without missing any deadline using a greedy scheduler.

    Heaps, Sorting & Searchbinary searchgreedysorting
  • Heaps, Sorting & SearchMediumAuto-graded
    Build Three-Color Outfits from Limited Inventory

    Tests greedy allocation with heap-based selection and mathematical reasoning about resource constraints under distinct-element requirements.

    Heaps, Sorting & Searchgreedyheapcombinatorics
  • Dynamic ProgrammingMediumAuto-graded
    Check if Text Can Be Built from Dictionary Words

    Tests dynamic programming with Trie optimization to determine if a string can be fully decomposed into a sequence of dictionary words.

    Dynamic Programmingtriestring-processingmemoization
  • Math & Bit ManipulationEasyAuto-graded
    Calculate Binomial Cumulative Probability for Limited Supply

    Tests understanding of binomial distributions and computing cumulative probabilities for discrete independent events.

    Math & Bit Manipulationprobabilitybinomial-distributioncombinatorics
  • Stacks & QueuesMediumAuto-graded
    Collapse Matching Neighbors

    Tests stack-based simulation to eliminate adjacent equal characters iteratively until no more cancellations are possible.

    Stacks & Queuesstackstring-manipulationsimulation
  • SQL & DataEasyAuto-graded
    Compute Running Departmental Budget Consumed

    Tests ability to implement window-style running totals by computing each row's cumulative spend within its department, ordered by date then transaction ID.

    SQL & Datawindow functionsrunning totalsdata processing
  • Trees & GraphsHardAuto-graded
    Feature Deployment with Integrity Checks and Dependency Ordering

    Verify configuration integrity using polynomial hashing, detect dependency cycles with DFS, and produce a lexicographically-ordered topological deployment sequence.

    Trees & Graphsgraph-traversaltopological-sorthashingcycle-detection
  • StringsMediumAuto-graded
    IPv4 Address Checker and Builder

    Tests string parsing, validation rules, and backtracking to check and generate valid IPv4 addresses from digit strings.

    Stringsbacktrackingvalidationstring-processing
  • Greedy & IntervalsEasyAuto-graded
    Intercept Aircraft and Count User Sessions

    Tests greedy deadline scheduling for time-critical interception tasks and event grouping with gap-based sessionization.

    Greedy & Intervalsgreedysortingsimulationevent-processing
  • Trees & GraphsHardAuto-graded
    Build Frequency-Based Binary Codec

    Tests ability to construct a deterministic frequency tree with tie-breaking, generate prefix-free binary codes, and encode/decode strings.

    Trees & Graphstreesheapsgreedybit-manipulation
  • Arrays & HashingMediumAuto-graded
    Find Longest Subarray with Bounded Absolute Difference

    Tests the ability to use two pointers alongside auxiliary tracking structures to find the longest contiguous subarray where max−min does not exceed a given threshold.

    Arrays & Hashingarraystwo pointerssliding window
  • Data Structure DesignMediumAuto-graded
    Build a Min-Heap Data Structure from Scratch

    Evaluates ability to implement a complete binary min-heap using array indexing, bubble-up, and bubble-down operations without library support.

    Data Structure Designheaps-sortingarraysdata-structures
  • Dynamic ProgrammingMediumAuto-graded
    Expected Wait Time and Coin Combination Counting

    Tests probability reasoning with independent random events and dynamic programming for combinatorial counting with unlimited resources.

    Dynamic Programmingprobabilityexpected-valuecombinatoricsunbounded-knapsack
  • StringsMediumAuto-graded
    Minimum Window Containing All Target Characters

    Tests the ability to efficiently find the smallest substring containing all required characters using sliding window and hash tables.

    Stringssliding-windowhash-maptwo-pointers
  • Arrays & HashingHardAuto-graded
    Expected Wait Time for Repeating Train Schedules

    Calculate and compare expected waiting times for transit services with different repeating gap patterns using length-biased sampling.

    Arrays & Hashingprobabilityexpected-valueinspection-paradox
  • Greedy & IntervalsMediumAuto-graded
    Optimal 1D Coverage: Minimize Worst-Case Distance to k Centers

    Tests binary-search-on-answer combined with a greedy interval feasibility check to solve the 1D k-center minimax placement problem.

    Greedy & Intervalsbinary-searchgreedysorting
  • Stacks & QueuesHardAuto-graded
    Check Balanced Brackets and Find Tree Level Width

    Tests stack-based matching for nested brackets and BFS position tracking to compute maximum horizontal distance in a binary tree.

    Stacks & Queuesstackbfstree-traversalstring-validation
  • StringsMediumAuto-graded
    Filter Files Without Write Access

    Tests string parsing and bitwise permission logic to identify files that lack write permissions across all user categories.

    Stringsstring-parsingfilteringpermissions
  • StringsMediumAuto-graded
    Maximum Distinct Character Window

    Tests sliding window technique with hash maps to find the longest contiguous span of non-repeating characters in a string.

    Stringssliding-windowhash-maptwo-pointers
  • Heaps, Sorting & SearchMediumAuto-graded
    Sort a Large Sequence Using Memory-Bounded Runs and a Heap

    Tests knowledge of two-phase external sorting: chunking a sequence into fixed-size sorted runs, then merging them efficiently with a min-heap.

    Heaps, Sorting & Searchheapsortingmergesimulation
  • Arrays & HashingMediumAuto-graded
    Detect Tic-Tac-Toe Termination on an n×n Grid

    Tests scanning all rows, columns, and diagonals for a complete line of matching non-zero marks, and detecting a full board with no remaining moves.

    Arrays & Hashingarraysmatrixgame-simulation
  • StringsEasyAuto-graded
    First Longest Word with Even Character Count

    Tests string parsing, filtering by character parity, tracking maxima with tie-breaking, and handling whitespace edge cases.

    Stringsstring-manipulationlinear-scanedge-cases
  • Greedy & IntervalsMediumAuto-graded
    Minimum Conference Rooms for Scheduled Meetings

    Tests greedy interval scheduling with heap-based resource allocation to find the smallest number of rooms needed for overlapping meetings.

    Greedy & Intervalsintervalsheapgreedyscheduling
  • Greedy & IntervalsEasyAuto-graded
    Count Rooms In Use at Peak Time

    Tests the sweep-line technique by finding the maximum number of meeting rooms simultaneously occupied across a set of half-open booking intervals.

    Greedy & Intervalsgreedysweep lineintervals
  • Trees & GraphsMediumAuto-graded
    Compute Subtree Sums from Parent Array

    Tests bottom-up aggregation in trees represented as parent arrays, requiring iterative traversal to avoid recursion limits on deep trees.

    Trees & Graphstreespost-orderaggregationiterative