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 61–90 of 737 results
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.
Auto-gradeddesignhash-mapheapttlDesign a router that stores path templates with {name} wildcards and resolves concrete paths to a handler plus captured values, preferring exact segments and backtracking when they dead-end.
Model answertriebacktrackingroutingstring-parsingExtend an in-memory bank with delayed payments that can be canceled, record success or failure for each, discard stale entries, and rank accounts by total outgoing money.
Model answerdesign-dsheaplazy-deletionsimulationSimulate a fixed-capacity cache that evicts the least recently used entry, replaying a list of get/put commands and returning each command's result.
Auto-gradedlru-cachehash-maplinked-listsimulationRefactor a small Python log-counting script so it filters on several status codes, optionally writes JSON, streams multi-gigabyte files in constant memory, and stays unit-testable.
Model answerpythonrefactoringstreamingcliSimulate a batch of record insertions and lookups with normalized names, TTL expiry, alias-chain following, cycle and hop-limit detection, and A/alias exclusivity.
Auto-gradedhash-mapsimulationdesignstring-normalizationAnswer repeated target-sum pair-count queries over two integer arrays while the second array receives point updates, using frequency maps.
Auto-gradedhash-mapfrequency-countcounting-pairssimulationSimulate a batch of operations on per-forum ordered staff lists, enforcing seniority rules for adding, moving down one place, and removing members.
Auto-gradeddesignhash-mapsimulationordered-listDesign a simulated memory manager over a fixed address range that supports two placement policies, splitting, merging of neighbors, and rejection of stale or forged release requests.
Model answermemory-allocatorlinked-listhash-mapcoalescingDesign a class that compresses a mostly-zero integer matrix into three CSR arrays, then use it to compute a matrix-vector product in time proportional to the non-zero count.
Model answersparse-matrixcsrmatrix-vector-multiplicationdata-structure-designDesign and implement a rate-limited article crawler that visits pages with unseen first letters before switching to random order, and explain how you would use an AI assistant to build it.
Model answerweb-crawlerrate-limitingfrontier-designai-pairingBuild an in-memory bank that supports deposits, payments, two-step transfers with expiring holds, a top-activity ranking, and customer merges that leave history untouched.
Model answerobject-oriented-designhash-mapheaplazy-expirySimulate a feature-flag service: match attribute rules, gate by a SHA-256 percentage bucket, and resolve conflicts so any matching "on" rule wins.
Auto-gradedsimulationhashingrules-enginedesignDesign a Minesweeper class with board rendering and click handling via flood fill, then adapt it to enormous boards with few mines using lazy state and on-demand counting.
Model answerdesignflood-fillbfssparse-data-structuresBuild an inverted index with token positions to answer whole-word and in-order phrase queries over documents, handling repeated words and punctuation.
Auto-gradedinverted-indexhash-mapbinary-searchtokenizationSimulate 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.
Auto-gradedsliding-windowdequehash-maprate-limiterExplain the Java Memory Model guarantees of volatile fields: visibility, happens-before ordering and reordering limits, its gaps such as compound atomicity, and when to prefer locks or atomics.
Model answerjavaconcurrencymemory-modelvolatileSimulate a bounded double-ended queue over a batch of commands using a circular buffer with constant-time operations and correct index wraparound.
Auto-gradeddequecircular-buffersimulationdesignProcess 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.
Auto-gradedhash-mapheapsimulationtie-breakingBuild an embedded byte-oriented key-value store on a checksummed append-only log, with an in-memory index, delete markers, thread safety and recovery that truncates a damaged tail.
Model answerstorage-engineappend-only-logcrash-recoverycrc32Simulate 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.
Auto-gradedsimulationqueuegraphstate-machineDesign and implement a fixed-size thread pool with safe task queueing, future result retrieval, exception handling, and graceful or forced shutdown mechanism using basic locks and condition variables.
Model answerconcurrencythread-pooldesignmultithreadingWrite a higher-order function that postpones a callback until calls have stopped for a given time, preserving this and arguments, and discuss cancel, flush and leading-edge variants.
Model answerjavascriptclosurestimersdebounceSimulate an in-memory task tracker handling creation, retrieval, updates, filtering, and deletion of tasks with valid state validation.
Auto-gradeddesign-dsarraysdata-structuressimulationDesign an in-memory service that issues reset tokens, enforces expiry and a failed-attempt cap, rejects reused passwords, and makes each token usable only once.
Model answerstate-machinehash-mapauthenticationttl-expiryDecide which questions of a form are visible by parsing typed answers and evaluating validated, nestable all/any conditions with numeric comparisons.
Auto-gradedparsingvalidationrecursiondecimalFind and fix the bugs in a broken fixed-capacity LRU cache, then make its acknowledged writes survive a crash using an append-only log, snapshots and atomic file replacement.
Model answerlru-cachedebuggingwrite-ahead-logcrash-recoverySimulate a command sequence on a context-based next-word model, using hash maps of counts and a lexicographic tie-break.
Auto-gradedhash-mapn-gramsimulationstring-processingBuild a thread-safe kitchen where producers place orders, chefs cook them, and customers block until their dish is ready, with no races, deadlocks, or busy-waiting.
Model answerconcurrencycondition-variableblocking-queuethread-safetyDesign a hash-map-backed store that records every write with an increasing timestamp, answers reads as of any past moment, and exports a frozen plain-map snapshot.
Model answerhash-mapbinary-searchversioningsnapshot