KatInterview

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

Coding Interview Problems

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

5995
Problems
2220
Auto-graded
15
Topics
270
Added today

Showing 2311–2340 of 2772 results

  • Data Structure DesignMediumModel answer
    Firewall Rule Engine with Prefix Matching

    Build a rule-based IP filter supporting CIDR blocks, priority resolution, and efficient queries for single IPs and prefix ranges.

    Data Structure Designtrienetworkingbit-manipulation
  • Trees & GraphsMediumAuto-graded
    Network Unification Timestamp

    Tests Union-Find data structure application to track dynamic graph connectivity and determine when all nodes merge into one component.

    Trees & Graphsunion-finddisjoint-setgraph-connectivity
  • Arrays & HashingMediumAuto-graded
    Binary Classifier Threshold & Cost Trade-off Calculator

    Tests whether candidates can compute F1, confusion matrix counts, and deployment cost for two classifier configurations, then select the cheaper model to deploy.

    Arrays & Hashingmachine-learningclassificationevaluation-metrics
  • Trees & GraphsHardAuto-graded
    Minimum Steps to Collect All Keys in a Grid Maze

    Tests BFS shortest path on a grid where state must encode both position and the set of collected keys, requiring multi-dimensional state space exploration.

    Trees & Graphsgraphsbfsgridbitmask
  • Math & Bit ManipulationMediumModel answer
    Infer Numeric Pattern and Identify Corrupted Element

    Determine which mathematical pattern a sequence follows, detect if one value is wrong, and predict the next term.

    Math & Bit Manipulationsequencespattern-recognitionedge-cases
  • Math & Bit ManipulationMediumAuto-graded
    Parse Mixed-Endian Binary Protocol Fields

    Tests byte-level manipulation to extract little-endian and big-endian integers from a raw byte buffer without relying on architecture-specific memory layout.

    Math & Bit Manipulationbit-manipulationbytesendianness
  • Arrays & HashingEasyAuto-graded
    Assign Each Person a Tracked ID or a Fallback Value

    Tests left-join logic and fallback lookups by requiring every person to appear with either their mapped ID or a supplied default.

    Arrays & Hashinghash-maplookupleft-join
  • Stacks & QueuesMediumAuto-graded
    Evaluate Arithmetic Expression with Operator Precedence

    Tests implementation of expression evaluation using stacks to handle operator precedence and parentheses correctly.

    Stacks & Queuesstackexpression-parsingoperator-precedence
  • Data Structure DesignMediumAuto-graded
    Compute Credit Ledger with Expiration

    Implement an in-memory ledger that manages time-limited credits with priority expiration and debt tracking.

    Data Structure Designheappriority-queuesimulation
  • StringsMediumAuto-graded
    Trending Tags in Time Window

    Tests filtering by time range, frequency counting with a dictionary, and sorting with multi-level tie-breaking rules.

    Stringshash-mapsortingstring-parsing
  • Data Structure DesignMediumModel answer
    Transactional Key-Value Store with Rollback Support

    Build a key-value store supporting nested transactions with set, get, delete, begin, commit, and rollback operations.

    Data Structure Designtransactionsstackstate-managementkey-value-store
  • Data Structure DesignEasyAuto-graded
    Multi-User File System with Snapshots and Account Consolidation

    Build an in-memory file storage system with per-user quotas, global file uniqueness, ranked retrieval, account merging, and atomic snapshot restore.

    Data Structure Designhash-mapsimulationdata-structure-design
  • Arrays & HashingMediumAuto-graded
    Amusement Park Capacity Expansion: Profit & Expected Value

    Tests financial modeling with expected-value decision-making, break-even sensitivity analysis, and revenue-based fee structures across expansion scenarios.

    Arrays & Hashingexpected-valuefinancial-modelingsensitivity-analysis
  • Math & Bit ManipulationMediumAuto-graded
    Match IP Address to Network Block

    Tests bitwise operations on IPv4 addresses, CIDR prefix matching, and linear search with early termination.

    Math & Bit Manipulationbit-manipulationipv4networkinglinear-search
  • Data Structure DesignMediumAuto-graded
    Incremental Entropy Tracker for Categorical Streams

    Build a data structure that efficiently computes Shannon entropy after each new categorical observation arrives.

    Data Structure Designstreamingentropyincremental-computation
  • Math & Bit ManipulationMediumAuto-graded
    Calculate Emergency Braking Distance and Decision

    Tests understanding of kinematic equations, motion physics, and numerical reasoning to determine whether a vehicle can stop in time given speed, obstacle distance, deceleration, and reaction delay.

    Math & Bit Manipulationphysicskinematicsnumerical-reasoning
  • Trees & GraphsMediumModel answer
    Chain Fragment Payloads by Matching Tags

    Order tagged fragments so each fragment's ending tag matches the next fragment's starting tag, then concatenate their payloads into a single output string.

    Trees & Graphsgraphsstring-manipulationgraph-traversal
  • Stacks & QueuesMediumAuto-graded
    Compute Arithmetic Expression with Operator Precedence

    Tests ability to parse and evaluate arithmetic expressions respecting operator precedence and left-to-right associativity without built-in eval.

    Stacks & Queuesparsingoperator-precedencemathstring-processing
  • Arrays & HashingMediumAuto-graded
    Classify Kernel Bottlenecks Using the Roofline Model

    Determine whether computational kernels are limited by arithmetic throughput or memory bandwidth using roofline analysis.

    Arrays & Hashingroofline-modelperformance-analysismemory-bandwidthcompute-bound
  • Data Structure DesignMediumAuto-graded
    Request Quota Tracker with Rolling Time Windows

    Tests your ability to track request counts per user within a sliding time window using efficient data structures.

    Data Structure Designsliding-windowqueuerate-limiting
  • Stacks & QueuesMediumAuto-graded
    Days Until Higher Temperature

    Tests efficient computation of the distance to the next strictly greater element using a monotonic stack to achieve linear time complexity.

    Stacks & Queuesmonotonic-stacknext-greater-elementarrays
  • Math & Bit ManipulationMediumAuto-graded
    Residue Distribution of Dice Sums and 2×2 Stochastic Determinants

    Tests whether a candidate can compute modular probability distributions over two-dice outcomes and derive the determinant formula for a constrained matrix class.

    Math & Bit Manipulationprobabilitylinear-algebramodular-arithmetic
  • Arrays & HashingMediumAuto-graded
    Top-K Document Retrieval by Cosine Similarity

    Tests vector similarity computation, efficient top-k selection with deterministic tie-breaking, and understanding of distance metrics in embedding spaces.

    Arrays & Hashingvectorssimilarityrankingnumerical-methods
  • Arrays & HashingMediumAuto-graded
    Add One to Array-Represented Number

    Tests array manipulation and carry logic when adding one to a number stored as an array of digits.

    Arrays & Hashingarrayssimulationmath
  • Data Structure DesignMediumModel answer
    Finding Consecutive Duplicates in Subarrays

    Design data structures to efficiently detect sequences of identical elements in an array and answer queries about their presence in suffixes.

    Data Structure Designarray-scanningpreprocessingrange-queries
  • Greedy & IntervalsMediumAuto-graded
    Peak Overlap Point Across Closed Intervals

    Tests whether a candidate can use sweep-line event counting to locate the smallest integer covered by the greatest number of closed intervals.

    Greedy & Intervalssweep-lineintervalsdifference-array
  • Arrays & HashingHardAuto-graded
    Maximum Likelihood Estimation for Uniform Distribution Bounds

    Tests understanding of MLE derivation for bounded distributions and bias correction in parameter estimation.

    Arrays & Hashingstatisticsestimationprobabilitymle
  • StringsEasyAuto-graded
    Sum Two Arbitrarily Large Signed Integers as Strings

    Tests digit-by-digit arithmetic with sign handling and carry/borrow logic for adding very large signed integers represented as strings.

    Stringsstring-manipulationmathdigit-arithmetic
  • Greedy & IntervalsEasyAuto-graded
    Schedule Maximum Jobs Within Deadlines

    Tests the classic greedy exchange-argument insight: sort jobs by deadline to maximise the number of unit-length jobs completed before their deadlines.

    Greedy & Intervalsgreedyintervalssorting
  • Greedy & IntervalsMediumAuto-graded
    Count Valid Sum Pairs

    Tests greedy two-pointer technique on sorted arrays to maximize disjoint pairs meeting a sum condition.

    Greedy & Intervalstwo-pointersgreedysorting