Topic
Data Structure Design interview problems
Caches, iterators, rate limiters and custom containers. 739 original problems, each with hidden test cases you can run in the browser.
53 easy589 medium97 hard
Showing 271–300 of 739 results
Design a thread-safe in-memory audio player with a queue, history, and a favorites list capped at three that rejects overflow deterministically rather than evicting.
Model answerdesigndequehash-mapconcurrencyDesign a small CRUD HTTP service that accepts raw text bodies but replies in JSON, then explain how to test an unseen function from its specification alone.
Model answerrest-apihttp-status-codesunit-testingflaskRead the last N lines of a huge file using reverse chunk seeking, and track active devices using an OrderedDict for fast sliding window health queries.
Model answerfile-iosliding-windowordered-dictsystem-design-dsReplay a list of operations on a fixed-size sliding window, reporting the distinct sender count and the largest payload size after each insertion.
Auto-gradedsliding-windowdequehash-mapheapSimulate operations on a prefix-compressed radix tree storing integer sequences, supporting sequence insertions and depth-first tree serialization.
Auto-gradedradix-treetriedata-structure-designtreesSimulate an in-memory ledger with held transfers that expire after a day, account merging, and a ranking of accounts by completed outgoing totals.
Auto-gradedsimulationhash-mapheapstate-managementSimulate a rolling-window mean over a stream of readings, handling the warm-up phase and keeping floating-point error from accumulating across long streams.
Auto-gradedsliding-windowqueuefloating-pointsimulationSimulate a thread-safe fixed-window rate limiter processing a sequence of request timestamps.
Auto-gradeddesignsimulationarraysDesign a thread-safe idempotency manager that executes tasks at most once per key, blocks concurrent callers, caches results with TTL, and cleans up expired records efficiently.
Model answerconcurrencycachingdesigndata-structuresDesign the internal data structures and API for a spreadsheet engine supporting raw inputs, computed values, dependency tracking, and formula evaluation.
Model answerData Structure DesignGraphCachingDependency TrackingSimulate a forward-only cursor over a list of rows, where a peek call is side-effect free and an advance call returns the next row or None at the end.
Auto-gradedsimulationiteratorcursordesignDesign and implement an in-memory pipeline to enrich telemetry events and evaluate dynamic suppression rules with multi-tenant scoping and fault tolerance.
Model answerdesignobject-orientedmulti-tenancypipelinesMaintain Shannon entropy of a growing token stream with constant-time updates and queries, avoiding catastrophic cancellation when one token dominates.
Auto-gradedstreamingnumerical-stabilityhash-mapentropyDesign an in-memory dispatch engine that pairs queued support tickets with available agents, extended to handle mid-task agent breaks and fair ticket re-queuing.
Model answerdesign-dsstacks-queuesheaps-sortingFind and fix the bugs in a round-robin server selector that handles pool changes and threads, then build a consistent-hash ring with virtual nodes that keeps key movement minimal.
Model answerload-balancingconsistent-hashingdebuggingconcurrencyConstruct an interactive 7-day schedule grid with hour slots, allowing users to add titled events via a clean, state-driven dialog without duplicate data sources.
Model answerfrontendreactstate-managementui-componentsReplay a list of queue commands against a bounded ring buffer, returning each command's result while handling wrap-around, full and empty states correctly.
Auto-gradedcircular-queuering-buffersimulationmodular-arithmeticDesign and write code for an in-memory document store that supports dynamic schemas, predicate filtering, projection, ordering, and index optimization.
Model answerin-memory-dbindexingdata-structuresdata-structure-designFour short fundamentals questions: what makes code safe under concurrent use, what a deadlock is, how to handle deadlocks, and how contiguous arrays compare with pointer-based linked lists.
Model answerconcurrencythread-safetydeadlockarraysSimulate a log of keyed insert and query commands, keeping a running maximum for each key so single-key and all-key peak queries are answered without rescanning data.
Auto-gradedhash-mapsimulationrunning-maximumdesignDesign a pool allocator that carves equal-sized slots from slabs, hands them out via an intrusive free list in O(1), respects alignment, and packs 9-byte payloads sensibly.
Model answermemory-allocatorslabfree-listalignmentSimulate a Least Recently Used (LRU) cache supporting fast lookups, insertions, updates, and capacity evictions across a series of operations.
Auto-gradedhash-tabledoubly-linked-listdesignEncodes a dictionary mapping string keys to string values into a binary protocol payload and splits it into fixed-size byte chunks.
Auto-gradedencodingbinarystringsdesign-dsSimulate an ordered list of color, delay and move commands on a box, tracking cumulative position and total waited time, and return a state snapshot after every command.
Auto-gradedsimulationstate-machinearraysmethod-chainingSimulate an execution stream aggregator tracking stack call frequency across threads with custom tie-breaking rules.
Auto-gradeddesign-dsarrayshash-tableSimulate an in-memory path trie driven by a list of add and search operations, with iterative traversal, path normalization, and exact rules for what counts as a file.
Auto-gradedtrietree-traversaliterative-dfssimulationSimulate a fixed-size key-value store that discards the least recently touched entry when full, by replaying a log of operations and returning each result.
Auto-gradedhash-maplinked-listsimulationcacheDesign a class to insert, remove, and query the largest group of anagram words in real time, exploring performance trade-offs for read and write loads.
Model answerdesign-dsstringsarraysSimulate a per-user file store with staged uploads, quota checks, ranked prefix queries, and atomic snapshot restores under two conflict policies.
Auto-gradeddesignhash-mapsimulationsortingSimulate a class that logs timestamped events and reports the K most frequent IDs in a closed time window, with out-of-order events and queries.
Auto-gradeddesignbinary-searchhash-mapsorting