KatInterview

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

Data Structure Design Interview Problems

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

5971
Problems
2211
Auto-graded
15
Topics
272
Added today

Showing 61–90 of 375 results

  • Data Structure DesignEasyAuto-graded
    Simulate a Task Board with Id-Keyed Commands

    Process a batch of add, update, get and delete commands against an in-memory task store keyed by id, returning one result per command.

    Data Structure Designhash-mapsimulationdesigndictionary
  • Data Structure DesignMediumAuto-graded
    Longest Dictionary Word Ending With a Given Tail

    Answer batches of suffix queries over a word list, returning the longest match with lexicographic tie-breaking, using a reversed-word trie with cached best words.

    Data Structure Designtriestringssuffixpreprocessing
  • Data Structure DesignHardAuto-graded
    Seat Row Simulator: Leftmost Block Booking and Group Release

    Simulate a row of seats where each booking takes the leftmost free block of a given length and a release frees all of a group's seats, efficiently on large inputs.

    Data Structure Designsegment-treelazy-propagationsimulationinterval-bookkeeping
  • Data Structure DesignEasyAuto-graded
    Simulate Stream Price Volatility Monitor

    Execute stateful stream commands to maintain the two most recent values and calculate their difference and floating-point average.

    Data Structure Designdesign-dssimulationstate-management
  • 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 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 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 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 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 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 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 DesignMediumAuto-graded
    Latest-Wins Priority Job Runner Simulation

    Simulate a job runner where resubmitting an ID overrides its earlier entry, testing heap-based lazy deletion with tie-breaking and run-once rules.

    Data Structure Designheaplazy-deletionsimulationhash-map
  • Data Structure DesignMediumAuto-graded
    Most Connected User Tracker with Variable Top-K Queries

    Maintain distinct-contact counts for users from undirected messages, answer the top user in O(1), and return a top-k list with deterministic tie-breaking.

    Data Structure Designhash-sethash-mapheapsimulation
  • Data Structure DesignEasyAuto-graded
    In-Memory Store with Transaction Layering

    Implement an in-memory key-value database supporting GET, SET, DELETE, and nested transaction semantics (BEGIN, ROLLBACK, COMMIT).

    Data Structure Designdesign-dsstacks-queuesarraysstrings
  • Data Structure DesignMediumAuto-graded
    Path-Addressed Tree Store: Replay a Command Log

    Simulate a path-keyed tree store by replaying a list of commands, testing trie or hash-map design, path validation, and exact failure semantics.

    Data Structure Designdesigntriehash-mapsimulation
  • Data Structure DesignHardAuto-graded
    Best-Fit Block Allocator with Coalescing and Log-Time Operations

    Simulate a best-fit extent allocator over a huge block range, where reserve and release must merge adjacent free runs and run in logarithmic time.

    Data Structure Designdesignordered-settreapcoalescing
  • Data Structure DesignMediumAuto-graded
    Batch Simulation of Conflict-Free Node Locks on a Rooted Tree

    Process a batch of lock, unlock and query operations on a rooted tree where no locked node may be an ancestor or descendant of another, using subtree ranges and Fenwick trees.

    Data Structure Designtreeeuler-tourfenwick-treedesign
  • Data Structure DesignMediumAuto-graded
    Simulate a Multi-User File Store with Quotas and Compression

    Simulate a command-driven in-memory file store with ownership, per-user quotas, prefix/suffix search, quota-driven eviction and size-changing renames.

    Data Structure Designdesignhash-mapsimulationsorting
  • Data Structure DesignMediumAuto-graded
    Replay Requests Through a Per-Key Throttle

    Simulate a per-key sliding-window throttle over a batch of timed requests, tracking only accepted requests and handling window-boundary expiry correctly.

    Data Structure Designsliding-windowdequehash-mapsimulation