KatInterview

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

Data Structure Design Interview Problems

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

5978
Problems
2214
Auto-graded
15
Topics
272
Added today

Showing 571–600 of 738 results

  • Data Structure DesignMediumModel answer
    Build a Time-Travel Key-Value Store with Snapshots

    Design a key-value store that supports cheap snapshots and historical reads without copying the entire map on each snapshot.

    Data Structure Designsnapshotsversioningbinary-searchcopy-on-write
  • Data Structure DesignHardModel answer
    Build a thread-safe sliding-window percentile monitor

    Implement a concurrent data structure that tracks latency measurements and computes approximate percentiles over a rolling time window with bounded memory.

    Data Structure Designconcurrencypercentileshistogramsliding-window
  • Data Structure DesignHardAuto-graded
    N-Player High-Card Showdown: Simulate and Score

    Tests object-style thinking, round-robin dealing, and deterministic simulation of a card game where each round's highest card wins all played cards.

    Data Structure Designsimulationqueuesgame-design
  • Data Structure DesignMediumModel answer
    Order Fulfillment Engine with Backorder Queue

    Process a stream of orders and restocks against live inventory, fulfilling backorders in arrival order before replenishing on-hand stock.

    Data Structure Designhash-mapqueuesimulationamortized-analysis
  • Data Structure DesignMediumModel answer
    Design a Money Transfer System with Pending Approvals

    Build an in-memory banking service supporting accounts, transaction history, and two-party transfers that only settle when the recipient explicitly accepts.

    Data Structure Designconcurrencyidempotencystate-machineobject-oriented-design
  • Data Structure DesignHardAuto-graded
    TTL-Aware LRU Cache with Lazy Expiration

    Tests ability to design an O(1) key-value store combining LRU eviction with per-entry time-to-live expiration using a hash map and doubly linked list.

    Data Structure Designlinked-listshash-mapcachelru
  • Data Structure DesignMediumModel answer
    Indentation-Aware Code Folding Engine

    Build a class that collapses and restores indentation-defined code blocks, tracking nested fold state and remapping display line numbers after each operation.

    Data Structure Designsimulationmonotonic-stackdata-structure-design
  • Data Structure DesignMediumModel answer
    Short-Circuit Async Boolean: Cancel Early, Return Fast

    Implement an async function that resolves true the moment any concurrent task returns true, cancelling all remaining work immediately.

    Data Structure Designasyncioconcurrencycancellationpython
  • Data Structure DesignEasyAuto-graded
    Replay an Operation Log to Answer Versioned Key Lookups

    Tests the ability to simulate a versioned key-value store by replaying a sequence of set/delete operations and answering point-in-time key lookups.

    Data Structure Designdata structuressimulationhash map
  • Data Structure DesignMediumAuto-graded
    Simulate LRU Cache with Composite Keys

    Tests understanding of LRU eviction policy, composite key normalization, and cache statistics tracking through command simulation.

    Data Structure Designlru-cachehashingordered-dictdata-structures
  • Data Structure DesignMediumModel answer
    Build an In-Memory Notebook System with Rollback

    Design and implement a versioned in-memory notebook system supporting CRUD, case-insensitive search, user management, and full state rollback via a change log.

    Data Structure Designversioningooprollbackhashmap
  • Data Structure DesignMediumAuto-graded
    Circular Buffer Deque with Auto-Resize

    Tests ability to build a double-ended queue on a ring-indexed array that doubles in capacity when full, keeping all operations amortized O(1).

    Data Structure Designdequecircular-arrayamortized-analysis
  • Data Structure DesignMediumModel answer
    React Grid with Formula Dependencies and Virtual Rendering

    Build a React component that displays a large editable grid, evaluates cell formulas with references, detects cycles, and renders only visible rows.

    Data Structure Designreactvirtualizationmemoizationdependency-graph
  • Data Structure DesignHardModel answer
    O(1) Insert, Delete, and Fair Random Draw from a Live Set

    Design a data structure that supports adding, removing, and uniformly sampling integer values, all in average O(1) time with no duplicates.

    Data Structure Designhash maparrayrandomizationdata structure design
  • Data Structure DesignMediumAuto-graded
    Build a Time-Aware Key-Value Store with Expiration Logic

    Tests data structure design, time-based expiration semantics, and clean handling of missing or stale entries in an in-memory cache.

    Data Structure Designhash-tabletime-simulationexpirationcache-design
  • Data Structure DesignMediumAuto-graded
    Digit Hand Showdown

    Classify numeric hands by frequency patterns with custom ranking, then break ties using positional comparison without sorting.

    Data Structure Designobject-oriented-designpattern-matchingextensibility
  • Data Structure DesignMediumModel answer
    Job Scheduler with Dependency Resolution

    Build a thread-safe scheduler that accepts jobs with dependencies, identifies runnable jobs, and tracks state transitions through success and failure.

    Data Structure Designstate-machinedependency-graphconcurrencysystem-design
  • Data Structure DesignMediumAuto-graded
    Session Key Manager with Deferred Cleanup

    Tests building a session-key store with TTL-based lazy eviction using a hash map and min-heap to process a sequence of operations.

    Data Structure Designheaphash-maplazy-deletionsimulation
  • Data Structure DesignMediumAuto-graded
    Find Unreceived IDs in a Sequential Stream

    Tests efficient gap tracking in a sequential ID space using sets and amortized range updates.

    Data Structure Designsetrange-trackingamortized-analysis
  • Data Structure DesignMediumModel answer
    Design a Formula Engine with Cycle Detection

    Build a computation system where cells hold values or formulas referencing other cells, detecting circular dependencies before they corrupt state.

    Data Structure Designgraphstopological-sortcycle-detection
  • Data Structure DesignMediumAuto-graded
    Binary Layout Manager with Dynamic Field Insertion

    Tests ability to maintain ordered sequences with efficient prefix-sum queries and positional insertions using balanced tree structures.

    Data Structure Designbinary-search-treeprefix-sumdata-structure-design
  • Data Structure DesignMediumModel answer
    Build a Tree System with LRU Cache and Command History

    Design a data structure for a tree where nodes can be read, modified, and traversed, with an LRU cache for fast access and an undo stack for reverting changes.

    Data Structure Designlru-cachetree-traversalcommand-patternundo-redo
  • Data Structure DesignMediumAuto-graded
    Priority Queue Scheduler + Expression Evaluator

    Tests heap-based priority scheduling with tie-breaking and recursive-descent expression parsing with variable substitution.

    Data Structure Designheapparsingdesign
  • Data Structure DesignMediumAuto-graded
    Rate Limiter with Bucket Drain Simulation

    Tests ability to model a rate-limiting algorithm with time-based decay, capacity bounds, and precise edge-case handling.

    Data Structure Designrate-limitingsimulationstate-machine
  • Data Structure DesignMediumModel answer
    Design a Shopping Cart with OOP: Catalog, Lines, and Totals

    Model a shopping cart in object-oriented code: add, update, and remove items, compute an exact total, and handle edge cases consistently.

    Data Structure Designobject-oriented designpythonmoney arithmetic
  • Data Structure DesignMediumAuto-graded
    Simulate a Cache with Recency-Based Eviction

    Tests data structure design by building an in-memory cache that removes the least recently accessed entry when full.

    Data Structure Designhash-maplinked-listcacheeviction-policy
  • Data Structure DesignMediumAuto-graded
    Count-Weighted Random Sampling with Dynamic Insertions and Removals

    Design a multiset supporting constant-time insert, remove, and random selection where each element's pick probability is proportional to its frequency.

    Data Structure Designhash-maparraysrandomizationdata-structure-design
  • Data Structure DesignMediumAuto-graded
    Simulate a Stack with Instant Maximum Access

    Tests data structure design skills by building a stack that supports O(log n) max retrieval and removal, including removal from the middle when duplicates exist.

    Data Structure Designstackheaplinked-listlazy-deletion
  • Data Structure DesignMediumAuto-graded
    Execute Banking Operations with Transaction History

    Tests command-pattern operation execution, input validation, atomic state transitions, and maintaining per-entity audit logs.

    Data Structure Designsimulationvalidationstate-management
  • Data Structure DesignMediumAuto-graded
    Build a Multi-User File System with Quotas and Compression

    Design an in-memory file manager tracking per-user storage limits, file operations, pattern matching, and size adjustments with atomic quota enforcement.

    Data Structure Designhash-tablessimulationdesign