KatInterview

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

Data Structure Design Interview Problems

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

5972
Problems
2212
Auto-graded
15
Topics
273
Added today

Showing 121–150 of 737 results

  • Data Structure DesignMediumModel answer
    Prefix-Caching Transform Runner with Single-Flight and LRU

    Build a thread-safe runner for chains of deterministic byte transforms that reuses cached prefixes, collapses concurrent duplicate work into one execution, and bounds memory with LRU eviction.

    Data Structure Designconcurrencylru-cachehashingsingle-flight
  • Data Structure DesignMediumAuto-graded
    Skill-Based Task Dispatcher Simulation

    Simulate a dispatcher that gives queued tasks to skilled workers by project priority and current load, using per-project queues and tie-break rules.

    Data Structure Designdesignsimulationheaphash-map
  • Data Structure DesignMediumAuto-graded
    Per-Key Token Bucket Admission Decisions

    Simulate independent token buckets per key over a request log, with exact fractional refill, capped capacity, and out-of-order timestamps, to decide which requests are admitted.

    Data Structure Designrate-limitertoken-buckethash-mapsimulation
  • Data Structure DesignMediumModel answer
    Build a Sampler That Picks Items in Proportion to Mutable Weights

    Design a structure holding items with positive integer weights that supports insert, delete and a weight-proportional random pick, each in logarithmic time.

    Data Structure Designfenwick-treeweighted-samplingrandomizationdata-structure-design
  • Data Structure DesignMediumModel answer
    Dealing and Ranking Three-Card Hands With an Extensible Rule Set

    Build a small card game that deals three cards per player from one deck, ranks hands by category, picks the winner, then extend the ranking with a suit-based category.

    Data Structure Designobject-oriented-designsimulationcomparisonextensibility
  • Data Structure DesignMediumAuto-graded
    Expiring Compute Credits: Earliest-Expiry-First Ledger Simulation

    Simulate a credit ledger replaying a command list, spending the soonest-expiring grants first, with all-or-nothing spends and time-based expiry.

    Data Structure Designheapsimulationgreedydesign
  • Data Structure DesignMediumAuto-graded
    Linked Cell Grid with Cycle-Safe Formula Updates

    Simulate a 26x26 grid whose cells hold integers or one-reference offset formulas, answering lookups lazily and rejecting any formula assignment that would close a dependency loop.

    Data Structure Designgraphcycle-detectionsimulationhash-map
  • Data Structure DesignMediumModel answer
    Searchable Dropdown Input with Live Async Suggestions in React

    Implement a React search box whose dropdown fills with suggestions from an abortable async source and works fully by keyboard and mouse, without ever showing outdated results.

    Data Structure Designreacthooksasyncaccessibility
  • Data Structure DesignHardModel answer
    Dynamic Room Occupancy Tracker with Top-K Ranking Query

    Design an in-memory system tracking occupancy and entry times across rooms, returning the busiest rooms in optimal logarithmic time per update.

    Data Structure Designdesign-dsheaps-sortinghash-map
  • Data Structure DesignEasyAuto-graded
    Replay Tennis Game Commands and Report Scores

    Simulate a single tennis game from a command log, tracking points, deuce, advantage and the winner, and return each score query's text.

    Data Structure Designsimulationstate-machinedesignstrings
  • Data Structure DesignHardAuto-graded
    Versioned Cache and Longest Dependency Chain

    Process a series of timestamped key-value operations and find the longest non-cyclic path in a dependency graph.

    Data Structure Designdesign-dstrees-graphsdynamic-programmingbinary-search
  • Data Structure DesignMediumModel answer
    Designing a Validated In-Memory Cache for Repeated Parsing

    Speed up a script that repeatedly parses files by adding a thread-safe, bounded, in-memory cache, and justify its keys, eviction, staleness checks and complexity.

    Data Structure Designcachinghash-maplruconcurrency
  • Data Structure DesignHardAuto-graded
    Simulate Alternating Tic-Tac-Toe Game Engine

    Process a series of game instructions to maintain state, validate turns and positions, and return outcome status for each operation.

    Data Structure Designdesign-dsarraysstate-machine
  • Data Structure DesignMediumAuto-graded
    Shift Ledger: Rates, Promotions and Bonus Windows

    Simulate a command stream for a shift ledger with deferred pay-rate changes, merged global bonus windows and a ranking of employees by hours worked.

    Data Structure Designdesignsimulationinterval-mergingsorting
  • Data Structure DesignMediumAuto-graded
    Resumable Batch Reader for a Linked Page Feed

    Simulate a stateful reader that serves batches of N items in order from a chained page feed, buffering surplus items and handling empty pages, loops and the end of the feed.

    Data Structure Designdesignpaginationbufferingsimulation
  • Data Structure DesignMediumAuto-graded
    Replay Bounded Cache Commands with Recency Eviction

    Simulate a fixed-capacity key-value store that evicts its stalest entry, replaying a command log in O(1) per step using a hash map and recency ordering.

    Data Structure Designlru-cachehash-mapdoubly-linked-listsimulation
  • Data Structure DesignMediumAuto-graded
    Replay a Recency-Evicting Cache from a Command Log

    Simulate a fixed-size cache that evicts the least recently used entry, by replaying text commands and collecting the answers to lookups in order.

    Data Structure Designlru-cachehash-mapordered-dictsimulation
  • Data Structure DesignMediumModel answer
    Design a Safe, Idempotent Auto-Approval Engine for Order Refunds

    Design and code a refund decision engine that applies pluggable rules, never refunds more than was paid, and handles retried or concurrent requests without paying twice.

    Data Structure Designdomain-modelingidempotencyrules-enginemoney-handling
  • Data Structure DesignMediumAuto-graded
    Replay Operations on a Bounded Recency-Evicting Store

    Simulate a fixed-size key-value store that evicts the stalest entry, replaying a list of get/put commands and returning each command's result.

    Data Structure Designhash-maplinked-listordered-dictsimulation
  • Data Structure DesignMediumAuto-graded
    Simulate a Cursor Editor with Sticky-Column Vertical Moves

    Replay a log of editor commands (type, backspace, move in four directions, render) on a single-cursor multi-line buffer, with a column that persists across vertical moves.

    Data Structure Designsimulationdesigncursorstrings
  • Data Structure DesignMediumAuto-graded
    Versioned Key-Field Store with Expiry and Time Travel

    Simulate a timestamped two-level store with expiring values, conditional updates, sorted prefix scans and historical lookups, driven by a batch of operations.

    Data Structure Designdesignhash-mapbinary-searchttl
  • Data Structure DesignHardModel answer
    Design a Tree-Based Storage Simulator with Auto-Renaming

    Build an in-memory file store that auto-creates parent folders, renames clashing files with the lowest free numeric tag, and lists folder contents in ASCII order.

    Data Structure Designdesigntreehash-setstrings
  • Data Structure DesignMediumModel answer
    Pluggable Payment Dispatch with Spring Bean Maps

    Design an extensible payment dispatcher in Spring where a Map of strategy beans is injected automatically and new payment methods need no changes to the service.

    Data Structure Designjavaspringstrategy-patternsolid
  • Data Structure DesignMediumModel answer
    BST In-Order Traversal Flow & Priority Queue Dispatcher

    Implement an in-order tree iterator with memory constrained by height, followed by a priority queue that handles multi-attribute ordering rules.

    Data Structure Designtreesstackheappriority-queue
  • Data Structure DesignMediumAuto-graded
    Priority Job Scheduler with Cancellation

    Simulate a scheduler that adds, cancels, and runs jobs by priority with FIFO tie-breaking, using lazy deletion on a heap so each operation stays logarithmic.

    Data Structure Designheappriority-queuelazy-deletionhash-map
  • Data Structure DesignMediumAuto-graded
    Subtree Access Rights Simulator for Advertiser Groups

    Simulate a log of grant, revoke and check operations on a rooted group tree, where a grant on a node also covers every node beneath it.

    Data Structure Designtreehash-setsimulationancestor-walk
  • Data Structure DesignMediumModel answer
    Modeling a Multi-Car Lift Dispatcher with Swappable Policies

    Design an object-oriented lift (elevator) control system: classes, per-car state machine, stop ordering, pluggable dispatch, edge cases, and testable core logic.

    Data Structure Designobject-oriented-designstate-machinestrategy-patternsimulation
  • Data Structure DesignMediumAuto-graded
    Prepaid Compute Credit Tracker with Replay-Safe Events

    Simulate a per-tenant credit ledger driven by a command list, rejecting overdrafts and repeated event ids while tracking balances in a hash map and a set.

    Data Structure Designhash-mapsimulationidempotencydesign
  • Data Structure DesignMediumAuto-graded
    Lantern Posts and Open Stretch Checks Along a Highway

    Process interleaved insert and query events on sparse integer coordinates, checking whether a symmetric window contains any previously inserted point, using binary search and a Fenwick tree.

    Data Structure Designfenwick-treebinary-searchcoordinate-compressionrange-query
  • Data Structure DesignMediumModel answer
    Building a Cache-Friendly Lookup Table for a Hot Loop

    Design a hash table for a performance-critical inner loop, covering collision strategy, memory layout, probing, load factor, prefetching, and how to benchmark it.

    Data Structure Designhash-tableopen-addressingsimdcache-optimization