Topic
Data Structure Design interview problems
Caches, iterators, rate limiters and custom containers. 737 original problems, each with hidden test cases you can run in the browser.
53 easy587 medium97 hard
Showing 121–150 of 737 results
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.
Model answerconcurrencylru-cachehashingsingle-flightSimulate a dispatcher that gives queued tasks to skilled workers by project priority and current load, using per-project queues and tie-break rules.
Auto-gradeddesignsimulationheaphash-mapSimulate 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.
Auto-gradedrate-limitertoken-buckethash-mapsimulationDesign a structure holding items with positive integer weights that supports insert, delete and a weight-proportional random pick, each in logarithmic time.
Model answerfenwick-treeweighted-samplingrandomizationdata-structure-designBuild 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.
Model answerobject-oriented-designsimulationcomparisonextensibilitySimulate a credit ledger replaying a command list, spending the soonest-expiring grants first, with all-or-nothing spends and time-based expiry.
Auto-gradedheapsimulationgreedydesignSimulate 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.
Auto-gradedgraphcycle-detectionsimulationhash-mapImplement 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.
Model answerreacthooksasyncaccessibilityDesign an in-memory system tracking occupancy and entry times across rooms, returning the busiest rooms in optimal logarithmic time per update.
Model answerdesign-dsheaps-sortinghash-mapSimulate a single tennis game from a command log, tracking points, deuce, advantage and the winner, and return each score query's text.
Auto-gradedsimulationstate-machinedesignstringsProcess a series of timestamped key-value operations and find the longest non-cyclic path in a dependency graph.
Auto-gradeddesign-dstrees-graphsdynamic-programmingbinary-searchSpeed 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.
Model answercachinghash-maplruconcurrencyProcess a series of game instructions to maintain state, validate turns and positions, and return outcome status for each operation.
Auto-gradeddesign-dsarraysstate-machineSimulate a command stream for a shift ledger with deferred pay-rate changes, merged global bonus windows and a ranking of employees by hours worked.
Auto-gradeddesignsimulationinterval-mergingsortingSimulate 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.
Auto-gradeddesignpaginationbufferingsimulationSimulate 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.
Auto-gradedlru-cachehash-mapdoubly-linked-listsimulationSimulate a fixed-size cache that evicts the least recently used entry, by replaying text commands and collecting the answers to lookups in order.
Auto-gradedlru-cachehash-mapordered-dictsimulationDesign 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.
Model answerdomain-modelingidempotencyrules-enginemoney-handlingSimulate a fixed-size key-value store that evicts the stalest entry, replaying a list of get/put commands and returning each command's result.
Auto-gradedhash-maplinked-listordered-dictsimulationReplay 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.
Auto-gradedsimulationdesigncursorstringsSimulate a timestamped two-level store with expiring values, conditional updates, sorted prefix scans and historical lookups, driven by a batch of operations.
Auto-gradeddesignhash-mapbinary-searchttlBuild 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.
Model answerdesigntreehash-setstringsDesign 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.
Model answerjavaspringstrategy-patternsolidImplement an in-order tree iterator with memory constrained by height, followed by a priority queue that handles multi-attribute ordering rules.
Model answertreesstackheappriority-queueSimulate 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.
Auto-gradedheappriority-queuelazy-deletionhash-mapSimulate 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.
Auto-gradedtreehash-setsimulationancestor-walkDesign an object-oriented lift (elevator) control system: classes, per-car state machine, stop ordering, pluggable dispatch, edge cases, and testable core logic.
Model answerobject-oriented-designstate-machinestrategy-patternsimulationSimulate 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.
Auto-gradedhash-mapsimulationidempotencydesignProcess 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.
Auto-gradedfenwick-treebinary-searchcoordinate-compressionrange-queryDesign a hash table for a performance-critical inner loop, covering collision strategy, memory layout, probing, load factor, prefetching, and how to benchmark it.
Model answerhash-tableopen-addressingsimdcache-optimization