KatInterview

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

Coding Interview Problems

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

6025
Problems
2231
Auto-graded
15
Topics
273
Added today

Showing 1831–1860 of 2784 results

  • Arrays & HashingMediumAuto-graded
    Check for Subarray Summing to Target

    Tests the ability to use prefix sums and a hash set to detect whether any contiguous slice of an array sums to a given value.

    Arrays & Hashingprefix-sumhash-setsubarray
  • Arrays & HashingMediumAuto-graded
    Locate Symbol-Structure Templates in a Number Grid

    Tests whether a candidate can slide a letter-template over an integer grid and detect every position where symbols and values form a valid one-to-one correspondence.

    Arrays & Hashinghash-mappattern-matchingmatrixisomorphism
  • Arrays & HashingHardAuto-graded
    Bayesian Coin Identification from Flip Observations

    Compute exact posterior probabilities over three weighted coins from a sequence of flips, plus the predictive probability the next flip is heads.

    Arrays & Hashingbayes-theoremprobabilityfractionsposterior-predictive
  • Data Structure DesignEasyAuto-graded
    Build a Fixed-Capacity Recency-Ordered Cache

    Tests whether you can design a cache that evicts the least-recently-touched entry in O(1) time using a hash map paired with an ordered structure.

    Data Structure Designhash-maplinked-listcacheOrderedDict
  • Data Structure DesignMediumAuto-graded
    Unified Entity Log with Mergeable ID Groups

    Tests ability to design a data structure that resolves multiple system-assigned IDs to a single entity and returns a chronologically merged observation history.

    Data Structure Designunion-finddesignsorting
  • Greedy & IntervalsEasyAuto-graded
    Budget Shopping from Array Suffix

    Tests greedy selection with precomputation, prefix sums, and binary search to maximize item counts under budget constraints.

    Greedy & Intervalsgreedybinary-searchprefix-sumsorting
  • Data Structure DesignMediumAuto-graded
    Two-Way Link Mapper: Shorten and Restore URLs

    Tests ability to design a bidirectional hash map structure that assigns stable short identifiers to long URLs and retrieves originals in O(1).

    Data Structure Designhash-mapdesignstrings
  • Math & Bit ManipulationHardModel answer
    Do Two Walkers Ever Share the Same Tile?

    Determine if two entities moving on an infinite 2D grid ever occupy the same cell at the same integer time step.

    Math & Bit Manipulationgeometrysimulationinterval-arithmetictwo-pointers
  • Heaps, Sorting & SearchMediumAuto-graded
    Find a Value in a Shifted Sorted Array

    Tests whether a candidate can run a single-pass binary search on a sorted array that has been cyclically shifted by an unknown offset.

    Heaps, Sorting & Searchbinary-searcharraysdivide-and-conquer
  • Arrays & HashingEasyModel answer
    Identify the Most Common Function Call in Application Logs

    Determine which function name occurs most often in a list of log entries and report its occurrence count.

    Arrays & Hashinghash-mapfrequency-countingiteration
  • Trees & GraphsMediumAuto-graded
    Largest Label Spread Across Graph Clusters

    Tests ability to find connected components in an undirected graph and compute the maximum difference between the highest and lowest node labels in any single component.

    Trees & Graphsunion-findgraphsconnected-components
  • Arrays & HashingHardAuto-graded
    Backtest a Mean-Reversion Trading System

    Tests ability to implement a complete trading backtest with entry/exit logic, transaction costs, performance metrics, train/test splits, and statistical validation.

    Arrays & Hashingbacktestingtime-seriesfinancesimulation
  • Arrays & HashingMediumAuto-graded
    Sequential Shape Placement on a Matrix

    Tests matrix manipulation, collision detection, and ordered simulation by placing fixed shapes onto a grid.

    Arrays & Hashingmatrixsimulationgreedy
  • StringsMediumAuto-graded
    Build All Balanced Bracket Sequences

    Tests recursion with constraint-based pruning to construct valid nested bracket strings without generating invalid candidates.

    Stringsrecursionbacktrackingcombinatorics
  • StringsMediumModel answer
    Rule Engine with Operator Precedence and Quoted Strings

    Build a transaction filter that evaluates accept/block rules in sequence, supporting field equality, boolean logic, AND/OR operators, and parentheses.

    Stringsparsingstring-matchingoperator-precedencetokenization
  • Arrays & HashingEasyAuto-graded
    Next Red Card: Conditional Draw Probability

    Tests conditional probability under sampling without replacement from a fixed-composition deck given observed draw history.

    Arrays & Hashingprobabilitycombinatoricsconditional-probability
  • Arrays & HashingMediumModel answer
    Three-Problem Algorithmic Challenge Set

    Solve three independent problems: tournament match counting, grid traversal with movement commands, and finding maximum sum of digit-disjoint pairs.

    Arrays & Hashingsimulationgraph-traversalbit-manipulationdfs
  • StringsMediumModel answer
    Build a CSV Parser from Scratch with Corruption Handling

    Write a from-scratch CSV tokenizer and data structure for downstream consumers, then extend it to handle rows with missing or extra fields.

    Stringsparsingcsvstring-manipulationerror-handling
  • Math & Bit ManipulationMediumAuto-graded
    Decode a Mixed-Radix Positional Number

    Tests the ability to convert a number represented in a variable base-per-digit (mixed-radix) system back to its standard base-10 integer value.

    Math & Bit Manipulationmathbase conversionnumber theory
  • Data Structure DesignMediumModel answer
    Build a Weighted Consistent Hash Ring

    Design and code a hash ring that maps keys to servers with virtual nodes, supporting weighted capacity and minimal key movement on topology changes.

    Data Structure Designhashingdistributed-systemsdata-structuresbinary-search
  • StringsMediumAuto-graded
    Longest Shared Leading-Digit Sequence Between Two Integer Lists

    Tests whether a candidate can avoid brute-force pair comparison by exploiting bounded digit counts to match prefixes efficiently with a hash set.

    Stringsstringsarrayshashing
  • Arrays & HashingMediumAuto-graded
    Session-Based Account Risk Scoring with Bayesian Updates

    Tests probabilistic modeling with the Binomial distribution, Bayes' theorem, two-stage classification pipelines, and F1-optimal threshold selection in a risk-scoring context.

    Arrays & Hashingprobabilitybayes-theorembinomial-distribution
  • Data Structure DesignMediumModel answer
    Dependency-Aware Job Scheduler with Priority Queues

    Build an in-memory scheduler that tracks job prerequisites, selects the next runnable job by a four-field priority rule, supports filtered queries, and detects deadlocks.

    Data Structure Designheaptopological-sortgraphsimulation
  • Arrays & HashingMediumAuto-graded
    Compute Correlation from Three Variance Values

    Tests whether a candidate can apply the variance-of-a-sum identity to extract correlation, and correctly handle the case where one variance is missing.

    Arrays & Hashingstatisticsmathprobability
  • Data Structure DesignMediumModel answer
    Continuous-Batch Inference Loop with Slot Refilling

    Implement a dynamic batching generation loop that keeps a fixed-size batch full by refilling completed slots from a waiting queue until all requests are served.

    Data Structure Designbatchinginferencesimulationqueue
  • Trees & GraphsHardAuto-graded
    Shortest Supplier Chain Between Two Vendors

    Tests BFS-based shortest-path traversal on an undirected graph, including path reconstruction and degree-of-separation counting with correct edge-case handling.

    Trees & GraphsgraphsBFSshortest-path
  • Arrays & HashingEasyAuto-graded
    Probability Inventory Covers Random Demand

    Compute the binomial CDF: the chance that at most s of n independent customers request a limited item.

    Arrays & Hashingprobabilitybinomial-distributioncombinatoricscdf
  • Arrays & HashingMediumAuto-graded
    Identify Customers With Unmet Service Needs

    Tests spatial hashing and set union logic to find customers whose required service tags are not collectively offered by any nearby vendor within a radius.

    Arrays & Hashingspatial-hashingset-operationsgrid-bucketing
  • Data Structure DesignMediumModel answer
    Model a Prepaid Spending Account with Transaction Limits

    Design a class hierarchy that tracks a spending cap, running balance, and transaction history while safely handling concurrent charges and edge-case inputs.

    Data Structure Designobject-oriented designconcurrencystate managementPython
  • StringsMediumModel answer
    Rule-Driven CSV Validator with Cross-Field Word Overlap

    Design and implement a configurable validator that flags per-field rule violations and excessive word overlap across fields in a company CSV.

    Stringscsv-parsingvalidationstring-normalizationrule-engine