KatInterview

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

Interview Practice Problems

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

5980
Problems
2215
Auto-graded
15
Topics
272
Added today

Showing 2011–2040 of 2215 results

  • Arrays & HashingMediumAuto-graded
    Delivery Experiment Design: Sample Size and Error Control

    Tests ability to calculate sample sizes for superiority and non-inferiority tests, apply multiple-testing corrections, adjust for clustering, and explain sequential monitoring.

    Arrays & Hashingstatisticsexperimental-designhypothesis-testingsample-size
  • Math & Bit ManipulationEasyAuto-graded
    Build the Hailstone Number Chain

    Simulating an iterative number transformation until a fixed point is reached, handling boundary conditions and large intermediate values.

    Math & Bit Manipulationsimulationiterationmathematical-sequences
  • StringsMediumAuto-graded
    Strict Numeric String Recognizer

    Tests whether candidates can implement a precise single-pass parser that accepts only well-formed integers, decimals, and scientific notation strings.

    Stringsstringsparsingtwo-pointers
  • StringsEasyAuto-graded
    Generate Number Sequence with Divisibility Rules

    Tests basic control flow, modular arithmetic, and string formatting by transforming numbers according to divisibility conditions.

    Stringsconditionalsmoduloiteration
  • Arrays & HashingHardAuto-graded
    Plurality and Instant-Runoff Vote Counting

    Tests aggregated vote counting, majority detection, and iterative candidate elimination in ranked-choice systems.

    Arrays & Hashingsimulationhash-mapvoting-algorithms
  • Arrays & HashingMediumAuto-graded
    Rearrange Array to Next Greater Sequence

    Tests in-place array manipulation to transform a sequence into its immediate lexicographic successor, wrapping to the smallest arrangement when needed.

    Arrays & Hashingarrayspermutationsin-placetwo-pointers
  • Dynamic ProgrammingMediumAuto-graded
    String Reversal with Contiguous Subarray Extremes

    Tests string manipulation and dynamic programming through reversing text and finding optimal contiguous subarrays by sum and product.

    Dynamic Programmingarraysstringskadanesubarray
  • StringsMediumAuto-graded
    Distribute and Expand Algebraic Products

    Tests recursive parsing, the distributive property of multiplication over addition, and constructing expanded expressions from nested operations.

    Stringsparsingrecursionstring-manipulation
  • Math & Bit ManipulationMediumAuto-graded
    Maximum Theater Group Seating Capacity

    Tests bitmask-based interval availability checking for constrained seat allocation with large input optimization.

    Math & Bit Manipulationbitmaskgreedyoptimization
  • Trees & GraphsMediumAuto-graded
    Subtree Sum Replacement in Level-Order Arrays

    Tests post-order traversal, heap indexing in complete binary trees, and efficient bottom-up aggregation without recursion.

    Trees & Graphsbinary-treespost-order-traversalcomplete-binary-treeaggregation
  • Data Structure DesignHardAuto-graded
    Streaming Median Query

    Tests balanced heap design to maintain dynamic order statistics with logarithmic insertions and constant-time median queries.

    Data Structure Designheapsdata-structuresstreamingmedian
  • Arrays & HashingHardAuto-graded
    Random Transfer Between Two Queues: Drain Time and Odds

    Tests ability to model a lazy symmetric random walk as a Markov chain, derive a closed-form hitting-time formula, and compute absorption probabilities analytically.

    Arrays & Hashingmarkov-chainsrandom-walkprobability
  • Trees & GraphsHardAuto-graded
    Earliest Moment a Social Network Becomes Fully Connected

    Tests offline dynamic graph connectivity using a segment-tree-over-time with a rollback-capable union-find to handle both edge insertions and deletions.

    Trees & Graphsunion-findsegment-treedynamic-connectivity
  • Heaps, Sorting & SearchEasyAuto-graded
    Minimum Largest Piece After K Cuts on a Log

    Tests binary search on the answer to find the minimum possible largest piece when splitting a log into at least K+1 pieces.

    Heaps, Sorting & Searchbinary searchgreedysorting
  • Dynamic ProgrammingMediumAuto-graded
    Pack Exactly K Items with Maximum Total Value

    Tests the candidate's ability to apply a 2D knapsack variant requiring exactly a fixed item count while maximizing value, combining count and capacity constraints via DP.

    Dynamic Programmingdynamic programmingknapsack2d dp
  • Heaps, Sorting & SearchMediumAuto-graded
    Count Active Users in Trailing Time Window

    Tests binary search on sorted lists to efficiently count distinct entities with at least one event in a sliding time range.

    Heaps, Sorting & Searchbinary-searchtime-seriessliding-window
  • Arrays & HashingMediumAuto-graded
    Balance and Settle Shared Costs

    Tests the ability to calculate net balances from shared expense records and generate transfers that zero out all debts.

    Arrays & Hashinghash-mapgreedysimulation
  • Data Structure DesignMediumAuto-graded
    Billing Ledger with Credit Prioritization and Backdating

    Process billing events where credits pay usage before subscription fees, supporting out-of-order event insertion with selective recomputation.

    Data Structure Designdata-structuressimulationordered-data
  • StringsMediumAuto-graded
    Minimum Window with K Distinct Characters

    Tests sliding window technique with character frequency tracking to find the smallest substring containing exactly k distinct characters.

    Stringssliding-windowhash-maptwo-pointers
  • Trees & GraphsMediumAuto-graded
    Schedule Tasks With Resource Unlock Dependencies

    Tests ability to apply topological ordering to determine a valid execution sequence of tasks where each task may unlock resources required by others.

    Trees & Graphsgraphstopological sortDAGKahn's algorithm
  • Greedy & IntervalsMediumAuto-graded
    Locate Uncovered Ranges Between Intervals

    Tests interval merging, sorting, and boundary logic to identify all missing integer ranges within the overall coverage span.

    Greedy & Intervalsintervalssortingmergingranges
  • Arrays & HashingMediumAuto-graded
    Balance Point Count in a Weighted Sensor Array

    Tests the ability to use prefix sums to efficiently count indices where the weighted sum to the left equals the weighted sum to the right.

    Arrays & Hashingarraysprefix sumshash maps
  • SQL & DataMediumAuto-graded
    Sequence Numbering Within Grouped Records

    Tests ability to assign sequential positions to records within partitions using sorting and grouping logic.

    SQL & Datawindow-functionssortinggrouping
  • Heaps, Sorting & SearchEasyAuto-graded
    Running Median After Each Insertion

    Tests median maintenance using two heaps to efficiently return the running median after each element is added to a growing sequence.

    Heaps, Sorting & Searchheapssortingmedian maintenance
  • Arrays & HashingMediumAuto-graded
    Maximum Straight-Line Distance Through Dangerous Zones

    Tests efficient grid reasoning with blocked regions and directional movement constraints using binary search.

    Arrays & Hashingbinary-searchgridgeometry
  • Arrays & HashingMediumAuto-graded
    Keep First Occurrence of Each Element

    Tests understanding of hash-based deduplication while maintaining insertion order in a single pass through an array.

    Arrays & Hashingarrayshash-setdeduplicationorder-preservation
  • Data Structure DesignMediumAuto-graded
    Time-Aware Key-Field Store with Expiration

    Tests ability to implement an in-memory store with nested key-field structure, lexicographic scanning, timestamps, and TTL-based expiration logic.

    Data Structure Designhash-mapsimulationtime-based-expiration
  • Trees & GraphsMediumAuto-graded
    Aggregate User Permissions Through Account Ancestry

    Tests hierarchical graph traversal and efficient permission accumulation using ancestor path lookup and set operations.

    Trees & Graphsgraphstreesbfscaching
  • Trees & GraphsMediumAuto-graded
    Calculate Cumulative Task Weights in a Dependency Graph

    Tests graph traversal and dynamic programming on DAGs to compute propagated weight contributions through dependency chains.

    Trees & Graphsgraphsdagtopological-sortdynamic-programming
  • Trees & GraphsMediumAuto-graded
    Rank Build Targets by Dependency Order

    Tests whether a candidate can produce a valid topological ordering of a build-dependency DAG and apply a precise tie-break rule when multiple orderings exist.

    Trees & Graphsgraphstopological sortBFSKahn's algorithm