KatInterview

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

Interview Practice Problems

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

5988
Problems
2219
Auto-graded
15
Topics
271
Added today

Showing 1861–1890 of 2219 results

  • Greedy & IntervalsMediumAuto-graded
    Minimum Transfers to Rebalance a Four-Zone Warehouse

    Tests whether you can compute the minimum number of item relocations to rebalance inventory across four warehouse zones using surplus/deficit reasoning.

    Greedy & Intervalsgreedyarraysoptimization
  • Arrays & HashingMediumAuto-graded
    Minimum Round-Trip Cost with Ordered Dates

    Tests prefix-minimum optimization to select two array indices under ordering constraints while minimizing their combined cost.

    Arrays & Hashinggreedyprefix-minimumarray-optimization
  • Heaps, Sorting & SearchMediumAuto-graded
    Select K Elements with Highest Occurrence Count

    Tests frequency counting with hash maps and efficient selection of top elements using heap-based algorithms.

    Heaps, Sorting & Searchhash-mapheapcountingfrequency-analysis
  • Arrays & HashingHardAuto-graded
    Group Activity Logs into Time-Based Sessions

    Tests time-series grouping, datetime arithmetic, gap-based segmentation, and aggregation with distinct counts.

    Arrays & Hashingtime-seriesgroupingdatetimeaggregation
  • Heaps, Sorting & SearchMediumAuto-graded
    Find Path with Highest Bottleneck Value in Grid

    Tests combining priority-queue graph traversal with bottleneck optimization to find the path whose minimum cell value is maximized.

    Heaps, Sorting & Searchgraph-traversaldijkstrabinary-searchunion-find
  • Trees & GraphsMediumAuto-graded
    Collect Binary Tree Node Values in Left-Root-Right Order

    Tests binary tree traversal using an explicit stack to visit nodes in left-root-right sequence from a level-order serialized input.

    Trees & Graphsbinary-treetraversalstackdeserialization
  • Heaps, Sorting & SearchMediumAuto-graded
    Running Median with Power-of-Two Bucket Tracking

    Tests two-heap streaming median maintenance combined with exact integer floor-log₂ bucketing to place each median into its enclosing power-of-two interval.

    Heaps, Sorting & Searchheapsmedianbit-manipulation
  • Data Structure DesignEasyAuto-graded
    Track User Votes with Deduplication

    Tests ability to maintain stateful vote tracking with idempotent operations and bounded history retrieval

    Data Structure Designhash-tablestate-managementdeduplication
  • Arrays & HashingMediumAuto-graded
    Subarrays with Odd Zero Frequency

    Tests understanding of prefix parity tracking and combinatorial counting to efficiently solve subarray problems.

    Arrays & Hashingprefix-sumtwo-pointersmath
  • Trees & GraphsMediumAuto-graded
    Filter Users by Active Connection Threshold

    Tests graph maintenance with dynamic edge insertion and deletion, proper handling of duplicates and missing edges, and final degree counting.

    Trees & Graphsgraphshash-tablesimulation
  • StringsMediumAuto-graded
    Minimum Edit Distance Between Two Palindromes

    Tests understanding of edit distance (insert, delete, substitute) by computing the minimum operations needed to transform one palindrome into another, reinforcing dynamic programming on strings.

    Stringsstringsdynamic programmingedit distancepalindromes
  • Math & Bit ManipulationEasyAuto-graded
    Calculate Weight in a Nested Balanced Mobile System

    Tests systematic application of balance constraints in a multi-level mobile where equal-arm bars divide weight evenly.

    Math & Bit Manipulationalgebrarecursionmathlogic
  • Greedy & IntervalsMediumAuto-graded
    Combine Overlapping Intervals

    Tests interval merging through sorting and linear scanning, focusing on edge-case handling for touching and nested ranges.

    Greedy & Intervalsintervalssortingarrays
  • Trees & GraphsMediumAuto-graded
    Minimum-Length Root-to-Leaf Path with Target Sum

    Tests tree traversal with state tracking to identify the shortest valid path satisfying a sum condition.

    Trees & Graphsbinary-treedfspath-finding
  • Math & Bit ManipulationEasyAuto-graded
    Digital Root via Modular Arithmetic

    Tests understanding of modular arithmetic by computing the digital root of a large integer without repeatedly summing digits in a loop.

    Math & Bit Manipulationmathmodular arithmeticnumber theory
  • Trees & GraphsMediumAuto-graded
    Signal Propagation Time to All Destinations

    Tests understanding of multi-source BFS to compute the longest shortest path from any source to all required destinations on a grid with obstacles.

    Trees & Graphsbreadth-first-searchgridmulti-source-bfsshortest-path
  • Arrays & HashingHardAuto-graded
    Survey Gender Distribution Probability

    Compute probabilities of observing specific gender counts in survey samples under binomial and hypergeometric models.

    Arrays & Hashingprobabilitystatisticscombinatorics
  • Arrays & HashingHardAuto-graded
    Classify Queries by Nearest Reference After Linear Transform

    Tests vectorized linear projection, pairwise distance computation, and nearest-neighbor selection with tie-breaking.

    Arrays & Hashingmatrix-operationsdistance-metricsvectorization
  • Arrays & HashingMediumAuto-graded
    Count Contiguous Segments Summing to K

    Tests efficient subarray counting using prefix sum differences tracked in a hash map.

    Arrays & Hashingprefix-sumhash-mapsubarray
  • Arrays & HashingMediumAuto-graded
    Four Utility Functions: Crop, Softmax, Gaussian, Triangle

    Tests array slicing, numerical stability in exponential calculations, 2D kernel generation, and geometric inequality validation in a single bundled function.

    Arrays & Hashingmathnumerical-methodsgeometry
  • Heaps, Sorting & SearchHardAuto-graded
    Build a Min-Heap and Schedule Tasks by Priority

    Construct a working min-heap from scratch, then apply it to schedule dependent tasks in lexicographic order while detecting cycles.

    Heaps, Sorting & Searchheaptopological-sortgraphdata-structures
  • Data Structure DesignHardAuto-graded
    Time-Versioned Key-Value Storage

    Implement a data structure that stores versioned values by timestamp and retrieves the most recent version at or before a query time.

    Data Structure Designbinary-searchhash-mapdata-structures
  • Data Structure DesignMediumAuto-graded
    Process Account Transaction Sequence

    Tests ability to implement stateful operations on indexed data with validation, edge-case handling, and multiple operation types.

    Data Structure Designsimulationvalidationstate-management
  • SQL & DataMediumAuto-graded
    Highest Revenue Product per Category with Returns

    Tests data aggregation, join logic, net-revenue calculation accounting for returns, and ranking with tie-breaking.

    SQL & Dataaggregationjoinsrankingwindow-functions
  • Math & Bit ManipulationMediumAuto-graded
    Balanced Digit Sum Across All Bases

    Tests understanding of base conversion by summing digits of a number across every base from 2 to b and checking whether each base yields a digit sum equal to a target value.

    Math & Bit Manipulationmathbit manipulationbase conversion
  • Data Structure DesignMediumAuto-graded
    Compute Dot Products for Memory-Efficient Integer Vectors

    Tests efficient sparse data representation using hash maps and optimizing operations by focusing on non-zero elements only.

    Data Structure Designhash-mapsparse-dataoptimization
  • StringsEasyAuto-graded
    Count Distinct Words in a Sentence

    Tests the ability to tokenize a raw sentence string into normalized word tokens and count how many distinct words appear exactly once.

    Stringsstringstokenizingparsing
  • Heaps, Sorting & SearchMediumAuto-graded
    Minimize the Maximum Delivery Time Across Routes

    Tests binary search on the answer combined with greedy feasibility checking to minimize the maximum delivery time when assigning parcels to couriers.

    Heaps, Sorting & Searchbinary searchgreedysorting
  • StringsEasyAuto-graded
    Count Distinct Morse Code Representations

    Tests string encoding with a fixed mapping, hashing for deduplication, and understanding that identical encodings can arise from different inputs.

    Stringshash-setstring-manipulationencoding
  • Greedy & IntervalsMediumAuto-graded
    Maximum Concurrent Reservations

    Calculate the peak number of overlapping time intervals to determine minimum resource capacity.

    Greedy & Intervalsintervalssweep-linesorting