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 91–120 of 737 results
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.
Auto-gradedhash-mapaggregationorder-booksimulationDecide 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.
Auto-gradedunion-findsimulationarraysgreedySimulate 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.
Auto-gradedheaphash-mapsimulationlazy-deletionSimulate obstacle course data structures, track per-stage times, calculate target metrics, and run Monte Carlo probability estimation.
Auto-gradeddesign-dsarraysstatisticsBuild a class that wraps a slow, paginated word API and serves exact word counts per call, keeping leftovers between calls and fetching pages lazily.
Model answerclass-designbufferingpaginationdequeDesign an in-memory shopping cart with exact money arithmetic, strategy-based promotions, an itemized receipt, and safe concurrent updates.
Model answerobject-oriented-designstrategy-patternvalue-objectconcurrencySimulate a bounded first-in-first-out buffer over a list of put and take commands, rejecting any command that would have to wait.
Auto-gradedqueuesimulationdesignfifoBuild a function that returns only the employee record fields a viewer may see, based on admin status, identity, department, reporting line, and view type.
Auto-gradedaccess-controldictionariessimulationrule-evaluationBuild an accessible type-ahead lookup that delays requests, discards outdated responses, remembers past queries, supports keyboard control, and copes with errors.
Model answerfrontendreactdebounceabortcontrollerWrite a vanilla JavaScript function that shows a message to the user and moves the page to a given address once the message is closed, skipping the move when the address is not a non-empty string.
Model answerjavascriptdombrowser-apisevent-handlingDesign an in-memory work tracker in four growing stages: CRUD, name and priority queries, per-user limits with timed assignments, then completion and lateness reports.
Model answerdesignin-memoryhash-mapsortingReplay 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).
Auto-gradeddesignhash-mapbinary-searchsliding-windowImplement a thread-safe, size-bounded rotating file sink class adhering to Liskov substitution and Python context manager protocols.
Model answerobject-oriented-designconcurrencyfile-iopythonIngest, normalize, filter, and stream-sort paginated API data under memory constraints with exponential backoff and rate limiting.
Model answerpaginationrate-limitingexternal-sortdata-engineeringCoordinate two concurrent threads to output consecutive integers from 1 to n in strictly alternating parity order.
Model answerconcurrencythreadingsynchronizationmutexSimulate a sequence of follow, unfollow, and query operations on a directed user graph, keeping outgoing and incoming edge views consistent and returning sorted results.
Auto-gradedhash-mapsetgraphdesignReview a C++ class hierarchy that owns a raw heap buffer, explain why passing it by value breaks it, and rewrite it with modern ownership and correct polymorphic dispatch.
Model answercppraiirule-of-fiveobject-slicingDesign a parser for fixed-arity payment commands and an object-oriented lifecycle state machine, and identify which business rules need clarification before implementation.
Model answerstate-machineparsingobject-oriented-designvalidationCompare how two languages implement functions with a variable number of arguments, then design a type-checked key-value logger that avoids injection and needless allocation.
Model answervariadic-functionstype-safetycalling-conventionsloggingSimulate a shelf of books with positional ordering, version-checked edits and ID-based bookmarks that survive reordering and are cleaned up on deletion.
Auto-gradeddesignhash-mapsimulationoptimistic-concurrencySimulate a ledger: order card transactions by time, compute integer fee and rebate, enforce balance limits, and flag repeated transaction IDs.
Auto-gradedsimulationsortinghash-setinteger-arithmeticDesign a streaming detector that flags users with 4 or more distinct devices logging in successfully within 10 minutes, tolerating events up to 30 seconds late, with bounded memory.
Model answersliding-windowstreamingwatermarkordered-mapDesign a testable, terminal-friendly engine for a falling-block puzzle on a 10x20 grid, covering movement, rotation, gravity, locking, line clearing and game over.
Model answergame-logicstate-machinesimulationobject-oriented-designSimulate 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.
Auto-gradedheaptopological-sortgraphsimulationSimulate 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.
Auto-gradedrate-limiterfixed-windowhash-mapsimulationProcess a batch of add, update, get and delete commands against an in-memory task store keyed by id, returning one result per command.
Auto-gradedhash-mapsimulationdesigndictionaryAnswer 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.
Auto-gradedtriestringssuffixpreprocessingSimulate 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.
Auto-gradedsegment-treelazy-propagationsimulationinterval-bookkeepingExecute stateful stream commands to maintain the two most recent values and calculate their difference and floating-point average.
Auto-gradeddesign-dssimulationstate-managementBuild an in-memory ledger of credit-holding workspaces in four stages: transfers with a top-k ranking, timed transfers with cancellation, workspace merges, and point-in-time balance lookups.
Model answerclass-designheapbinary-searchsimulation