KatInterview

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

Data Structure Design Interview Problems

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

5969
Problems
2211
Auto-graded
15
Topics
272
Added today

Showing 31–60 of 375 results

  • Data Structure DesignMediumAuto-graded
    Ring-Buffer Deque with Constant-Time Indexing

    Build a double-ended queue on a resizable circular array so index lookups are O(1), then replay a command list against it and report each result.

    Data Structure Designcircular-bufferdequedynamic-arrayamortized-analysis
  • Data Structure DesignMediumAuto-graded
    Simulate Stacked Rectangles on a Small Text Canvas

    Simulate add, remove, reorder and render commands on a layered character canvas, resolving overlaps by layer order and clipping shapes at the edges.

    Data Structure Designsimulationordered-dictdesignclipping
  • Data Structure DesignMediumAuto-graded
    Log Record Dedup: Batch Merge and Watermarked Replay

    Deduplicate log records by event id under a first or latest policy, then replay an operation list through a watermark-based stream deduplicator that drops late data and evicts finalized entries.

    Data Structure Designhash-mapsortingstreamingwatermark
  • Data Structure DesignHardAuto-graded
    Credit Ledger Simulator with Merges and Delayed Rewards

    Simulate a timestamped ledger with deposits, transfers, spends with delayed cashback, account merges and spend rankings, using union-find and a min-heap.

    Data Structure Designdesignunion-findheapsimulation
  • Data Structure DesignMediumAuto-graded
    Expiring Key-Value Store Driven by a Virtual Clock

    Simulate a key-value store with per-key expiry on a manual clock, handling overwrites, deletes and cleanup of expired entries via a command list.

    Data Structure Designdesignhash-mapheapttl
  • Data Structure DesignMediumAuto-graded
    Replay a Sequence of Recency-Evicting Cache Commands

    Simulate a fixed-capacity cache that evicts the least recently used entry, replaying a list of get/put commands and returning each command's result.

    Data Structure Designlru-cachehash-maplinked-listsimulation
  • Data Structure DesignMediumAuto-graded
    Batch Simulator for a TTL-Aware Name Lookup Service with Aliases

    Simulate a batch of record insertions and lookups with normalized names, TTL expiry, alias-chain following, cycle and hop-limit detection, and A/alias exclusivity.

    Data Structure Designhash-mapsimulationdesignstring-normalization
  • Data Structure DesignMediumAuto-graded
    Live Complement Counting with Point Updates on One Array

    Answer repeated target-sum pair-count queries over two integer arrays while the second array receives point updates, using frequency maps.

    Data Structure Designhash-mapfrequency-countcounting-pairssimulation
  • Data Structure DesignMediumAuto-graded
    Ranked Staff Roster Across Multiple Forums with Swap-Down

    Simulate a batch of operations on per-forum ordered staff lists, enforcing seniority rules for adding, moving down one place, and removing members.

    Data Structure Designdesignhash-mapsimulationordered-list
  • Data Structure DesignMediumAuto-graded
    Flag Rule Resolver with Hash-Bucketed Rollouts

    Simulate a feature-flag service: match attribute rules, gate by a SHA-256 percentage bucket, and resolve conflicts so any matching "on" rule wins.

    Data Structure Designsimulationhashingrules-enginedesign
  • Data Structure DesignMediumAuto-graded
    Batch Word and In-Order Phrase Lookup Over Text Documents

    Build an inverted index with token positions to answer whole-word and in-order phrase queries over documents, handling repeated words and punctuation.

    Data Structure Designinverted-indexhash-mapbinary-searchtokenization
  • Data Structure DesignMediumAuto-graded
    Rolling-Window Request Throttle Per Client Address

    Simulate a per-IP sliding-window-log throttle over a sequence of requests, using per-key queues with lazy expiry and strict half-open window boundaries.

    Data Structure Designsliding-windowdequehash-maprate-limiter
  • Data Structure DesignMediumAuto-graded
    Ring Buffer Double-Ended Queue Simulator

    Simulate a bounded double-ended queue over a batch of commands using a circular buffer with constant-time operations and correct index wraparound.

    Data Structure Designdequecircular-buffersimulationdesign
  • Data Structure DesignMediumAuto-graded
    Live Poll Leaderboard: Track the Current Front-Runner

    Process a batch of vote and leader-query operations over named options, using counters and a tie-break rule to report the current leader after each query efficiently.

    Data Structure Designhash-mapheapsimulationtie-breaking
  • Data Structure DesignHardAuto-graded
    Fault-Tolerant Task Dispatcher with Retry Limit and Dependencies

    Simulate a job queue where failed jobs retry up to a limit, then go to a dead-letter list, and failures cascade to jobs that depend on them.

    Data Structure Designsimulationqueuegraphstate-machine
  • Data Structure DesignEasyAuto-graded
    Simulate a Task Management Engine with CRUD Operations

    Simulate an in-memory task tracker handling creation, retrieval, updates, filtering, and deletion of tasks with valid state validation.

    Data Structure Designdesign-dsarraysdata-structuressimulation
  • Data Structure DesignMediumAuto-graded
    Conditional Form Visibility with Numeric Checks and Nested Groups

    Decide which questions of a form are visible by parsing typed answers and evaluating validated, nestable all/any conditions with numeric comparisons.

    Data Structure Designparsingvalidationrecursiondecimal
  • Data Structure DesignMediumAuto-graded
    Phrase Completion Engine with Windowed Context Counts

    Simulate a command sequence on a context-based next-word model, using hash maps of counts and a lexicographic tie-break.

    Data Structure Designhash-mapn-gramsimulationstring-processing
  • Data Structure DesignMediumAuto-graded
    Top-of-Book Quotes per Venue and Across All Venues

    Aggregate order records by price level to answer per-venue and market-wide best bid and ask queries, summing the size at the best price.

    Data Structure Designhash-mapaggregationorder-booksimulation
  • Data Structure DesignMediumAuto-graded
    Seat Assignment with Forward-Only Probing on a Fixed Row

    Decide whether every request in a sequence can be seated in a fixed row when taken spots push it to the next free higher slot; tests efficient next-free-slot lookup, e.g. with union-find.

    Data Structure Designunion-findsimulationarraysgreedy
  • Data Structure DesignMediumAuto-graded
    Prioritized Delayed Job Queue Simulator

    Simulate a delayed job queue by replaying a log of schedule, reschedule, cancel and poll operations, returning each result in order while respecting priority and time ordering.

    Data Structure Designheaphash-mapsimulationlazy-deletion
  • Data Structure DesignMediumAuto-graded
    Track and Analyze Obstacle Course Runs

    Simulate obstacle course data structures, track per-stage times, calculate target metrics, and run Monte Carlo probability estimation.

    Data Structure Designdesign-dsarraysstatistics
  • Data Structure DesignEasyAuto-graded
    Replay Operations on a Fixed-Capacity FIFO Buffer

    Simulate a bounded first-in-first-out buffer over a list of put and take commands, rejecting any command that would have to wait.

    Data Structure Designqueuesimulationdesignfifo
  • Data Structure DesignEasyAuto-graded
    Field-Level Visibility Filter for Employee Records

    Build a function that returns only the employee record fields a viewer may see, based on admin status, identity, department, reporting line, and view type.

    Data Structure Designaccess-controldictionariessimulationrule-evaluation
  • Data Structure DesignMediumAuto-graded
    Sliding Log Window: Distinct Tags and Dominant Tag Since a Cutoff

    Replay operations on a bounded, timestamp-ordered log of the newest entries, answering cutoff queries with the distinct key count and the most frequent key (smallest on ties).

    Data Structure Designdesignhash-mapbinary-searchsliding-window
  • Data Structure DesignMediumAuto-graded
    Batch Processor for a Directed Follow Graph

    Simulate a sequence of follow, unfollow, and query operations on a directed user graph, keeping outgoing and incoming edge views consistent and returning sorted results.

    Data Structure Designhash-mapsetgraphdesign
  • Data Structure DesignMediumAuto-graded
    Shelf Command Simulator with Versioned Edits and Durable Bookmarks

    Simulate a shelf of books with positional ordering, version-checked edits and ID-based bookmarks that survive reordering and are cleaned up on deletion.

    Data Structure Designdesignhash-mapsimulationoptimistic-concurrency
  • Data Structure DesignMediumAuto-graded
    Card Settlement Batch with Fees, Rebates and Duplicate Guard

    Simulate a ledger: order card transactions by time, compute integer fee and rebate, enforce balance limits, and flag repeated transaction IDs.

    Data Structure Designsimulationsortinghash-setinteger-arithmetic
  • Data Structure DesignMediumAuto-graded
    Deadline-First Job Queue with Prerequisite Gating

    Simulate a job queue where jobs unlock after their prerequisites are consumed, always serving the earliest-deadline unlocked job; tests heaps, dependency counting, and tie-breaking.

    Data Structure Designheaptopological-sortgraphsimulation
  • Data Structure DesignMediumAuto-graded
    Two-Tier Fixed-Window Request Throttle Simulator

    Simulate a throttle that enforces a shared limit and a per-key limit over epoch-aligned fixed windows, with lazy reset and a defined precedence between the two rejection reasons.

    Data Structure Designrate-limiterfixed-windowhash-mapsimulation