KatInterview

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

Interview Practice 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 1291–1320 of 2231 results

  • Data Structure DesignMediumAuto-graded
    Maintain Dynamic Multiset with Rank Queries

    Tests the ability to build a structure that handles insertions and k-th largest queries efficiently using a Fenwick tree over the value domain.

    Data Structure Designfenwick-treebinary-indexed-treerank-queriesmultiset
  • Data Structure DesignMediumAuto-graded
    Simulate a Least Recently Used Cache with Fixed Capacity

    Tests understanding of LRU eviction policy through hash map and doubly-linked list composition to achieve O(1) operations.

    Data Structure Designhash-maplinked-listcachelru
  • Math & Bit ManipulationMediumAuto-graded
    Tank Filling: Can You Hit an Exact Volume?

    Tests whether a candidate can apply GCD-based number theory and state-space reasoning to determine if a target volume is reachable with two containers.

    Math & Bit Manipulationmathbfsnumber-theory
  • Dynamic ProgrammingMediumAuto-graded
    Best Path Sum in Triangle with Required Cell Constraint

    Computes the maximum path sum descending through a triangular grid, both unconstrained and when forced through a specific cell.

    Dynamic Programmingdynamic-programmingpathsoptimization
  • StringsMediumAuto-graded
    Find All Pattern Positions in Text

    Tests implementation of efficient string matching and understanding of linear-time pattern search algorithms.

    Stringsstring-matchingkmppattern-search
  • Trees & GraphsMediumAuto-graded
    Grid Obstacle Distances and Palindrome Ancestor Paths

    Tests two skills at once: directional obstacle scanning on a 2D grid, and bitmask-based palindrome counting over rooted-tree ancestor segments.

    Trees & Graphsgridbit-manipulationdfs
  • Arrays & HashingEasyAuto-graded
    Paginated Sensor-Alert Filter with Validation

    Tests ability to validate, filter, sort, and paginate structured records while handling malformed entries and boundary conditions correctly.

    Arrays & Hashingarraysfilteringpagination
  • Arrays & HashingMediumAuto-graded
    Bayesian Guessing Game with Unknown Coin Bias

    Compute expected optimal winnings when sequentially guessing coin flips with a uniform-prior unknown bias.

    Arrays & Hashingprobabilitybayesianexpected-valuedynamic-programming
  • SQL & DataEasyAuto-graded
    Reconcile User Settings from Snapshot and Activity Log

    Tests table joins, state reconciliation, and handling baseline data overridden by timestamped events

    SQL & Datadata-manipulationjoinsstate-reconciliation
  • Dynamic ProgrammingMediumAuto-graded
    Fewest Items to Hit an Exact Weight Target

    Tests whether a candidate can apply 0/1 knapsack DP to find the minimum number of items from a list whose weights sum to exactly a given target.

    Dynamic Programmingdynamic-programmingknapsackarrays
  • Dynamic ProgrammingMediumAuto-graded
    Maximum Reward Within a Spending Limit

    Tests whether a candidate can apply 0/1 knapsack dynamic programming to maximize total reward without exceeding a fixed spending cap.

    Dynamic Programmingdynamic-programmingknapsackoptimization
  • Data Structure DesignHardAuto-graded
    Type-Safe Storage with Lifetime Tracking

    Tests understanding of object lifetime management, type tracking, and exception safety in a discriminated union implementation.

    Data Structure Designobject-lifetimetype-safetyexception-handling
  • Greedy & IntervalsHardAuto-graded
    Maximize Paired Sum with Coverage Constraint

    Tests greedy reasoning and sorting to maximize the sum of "lesser" elements across a constrained pairing of an even-length array.

    Greedy & Intervalsgreedysortingarrays
  • Arrays & HashingMediumAuto-graded
    Longest Contiguous Subarray with a Target Sum

    Tests prefix-sum reasoning, hash-map lookups, and precise tie-breaking to find the longest subarray summing to exactly k.

    Arrays & Hashingprefix-sumshash-maparrays
  • Data Structure DesignHardAuto-graded
    Versioned Membership Tracker with Point-in-Time Queries

    Tests ability to design a copy-on-write set that records per-element change history and answers historical membership queries in O(log n) via binary search.

    Data Structure Designbinary searchdesignhash map
  • Data Structure DesignMediumAuto-graded
    Sliding Window Request Rate Calculator

    Tests the ability to implement time-bucketed sliding-window aggregation with efficient memory usage and amortized constant-time operations.

    Data Structure Designsliding-windowtime-seriesdata-structuresamortized-analysis
  • SQL & DataMediumAuto-graded
    Player Activity Running Totals with Date Gaps

    Tests aggregation, running sums, and date-range densification without recursion—core skills for analytics pipelines.

    SQL & Datawindow-functionsaggregationdate-handling
  • Data Structure DesignMediumAuto-graded
    Sliding Window Event Log with Time-Based Expiration

    Design a data structure that tracks timestamped events and supports queries over a moving time window with automatic expiration of old entries.

    Data Structure Designsliding-windowqueuestime-seriesdata-structures
  • StringsMediumAuto-graded
    Minimum Window Containing All Required Characters

    Tests sliding window technique with character frequency tracking to find the smallest substring that satisfies multiplicity constraints.

    Stringssliding-windowtwo-pointershash-map
  • StringsMediumAuto-graded
    Parse and Validate Business Registration CSV Records

    Tests multi-rule sequential validation over CSV rows: field presence, tax ID format normalization, and fuzzy owner name matching via token overlap.

    Stringsstringsparsingvalidation
  • SQL & DataMediumAuto-graded
    Per-Group Top-3 Distinct Values with Tie Handling

    Tests whether you can isolate the three highest distinct numeric values within each group and return all records that match those values, preserving correct sort order.

    SQL & Datagroupingdense-ranksorting
  • Trees & GraphsMediumAuto-graded
    Balance Root-to-Leaf Path Sums in Binary Tree

    Tests bottom-up tree traversal with greedy balancing, recognizing that shared ancestors minimize total increments across multiple paths.

    Trees & Graphsbinary-treegreedypost-order-traversaltree-dp
  • Data Structure DesignMediumAuto-graded
    Aggregate Sales Data with Running and Grand Totals

    Tests dictionary aggregation, deterministic ordering, and building cumulative totals along two dimensions from grouped records.

    Data Structure Designaggregationdictionariesdata-processing
  • SQL & DataMediumAuto-graded
    MySQL Expression Results

    Tests understanding of MySQL type coercion, boolean evaluation, and string comparison functions.

    SQL & Datatype-coercionsqlboolean-logic
  • StringsMediumAuto-graded
    Count Balanced Two-Block Substrings in a Binary String

    Tests whether a candidate can group consecutive identical characters into runs and use adjacent run lengths to efficiently count valid balanced substrings.

    Stringsstringstwo-pointersrun-length-encoding
  • SQL & DataMediumAuto-graded
    Reduce Subscription Events to Latest User Status

    Collapse an append-only subscription event log into one status row per user, picking the newest event per user with a deterministic tie-break.

    SQL & Dataevent-logdeduplicationgroupingdatetime-parsing
  • Trees & GraphsMediumAuto-graded
    Minimum Steps Through an Obstacle Map

    Tests ability to model a 2D grid as an unweighted graph and apply BFS to find the fewest moves between two corners while avoiding walls.

    Trees & Graphsbfsgraphsgrid
  • Data Structure DesignMediumAuto-graded
    Simulated Word Store with Prefix Query

    Tests trie-style prefix counting logic via operation replay, with optional case-insensitive and trailing-digit normalization flags.

    Data Structure Designtriestringssimulation
  • Heaps, Sorting & SearchMediumAuto-graded
    Find k Nearest Values in Sorted Array

    Tests binary search on window positions with careful tie-breaking that prefers smaller values when distances are equal.

    Heaps, Sorting & Searchbinary-searchsliding-windowtwo-pointers
  • Data Structure DesignHardAuto-graded
    Running Median Over a Live Integer Feed

    Tests whether a candidate can design a two-heap structure that inserts integers and queries the running median in better than O(N) time per operation.

    Data Structure Designheapsdesignstreaming