Topic
Data Structure Design interview problems
Caches, iterators, rate limiters and custom containers. 738 original problems, each with hidden test cases you can run in the browser.
53 easy588 medium97 hard
Showing 241–270 of 738 results
Design and code a fixed-capacity, multi-producer multi-consumer buffer with timed blocking put/get, fair waiter ordering, clean shutdown and backpressure, and explain how you would test it.
Model answerconcurrencysynchronizationcondition-variablesbackpressureCoordinate grid-based worker nodes to perform memory-efficient distributed matrix multiplication without deadlocks.
Model answerdistributed systemsmatrix multiplicationconcurrencyalgorithmsDesign and code a bank ledger that grows in stages: cash operations, per-account statements with failures, internal and external transfers with fees, and delayed transfers that lock funds.
Model answerledgermoney-handlingobject-oriented-designtransactionsSimulate an in-memory single-table key-value store supporting lookup, update, and sorted conditional selection queries.
Auto-gradedhash-mapdesignsortingstringsSimulate a tracker that links IDs across two systems, stores observations, and returns time-ordered merged histories, testing union-find style grouping and operation replay.
Auto-gradedunion-finddesignhash-mapsortingGenerate discrete random samples according to custom category weights in constant time per sample using Vose's alias algorithm.
Auto-gradedarraysdesign-dsmath-bitsSimulate a versioned basket engine that aggregates multi-recipe component quantities for bulk discount calculations, supporting mutations and rollback operations.
Auto-gradeddesign-dsarrayshashingDesign an in-memory ledger that handles idempotent transfers, top-k senders, rewards posted 24 hours after a purchase, and account merging, and explain how you would test and scale it.
Model answerdesignhash-mapheapidempotencySimulate a sharded order book that routes users with FNV-1a, enforces a one-way status lifecycle, and answers per-user open-order queries in placement order.
Auto-gradedhash-mapsimulationstate-machinehashingDesign an object-oriented component that ingests ad events and returns windowed per-campaign metric sums and ratios, while letting new event types be added without editing core code.
Model answerobject-oriented-designtime-seriesprefix-sumsbinary-searchSimulate a key-value store that logs reads and writes with timestamps and answers per-second average rate queries over trailing windows, using compact time buckets.
Auto-gradeddesignsliding-windowdequehash-mapSimulate a command-driven chat engine that dispatches messages to registered responders, keeps per-channel logs and per-responder state, and returns the resulting logs.
Auto-gradeddesignsimulationoophash-mapSimulate a priority queue of alerts that serves the highest risk first and the oldest first on ties, driven by a list of Put and GetNext commands.
Auto-gradedpriority-queueheapdesignsimulationProcess sequential financial operations with scheduled transfers, account merging, historical snapshot queries, and activity rankings using heaps and binary search.
Auto-gradeddesign-dsheaps-sortingarraysConstruct an XOR string transformation function alongside an expected constant-time randomized container structure.
Model answerArraysHash MapBit ManipulationDesignSimulate a mutable integer set whose iterators capture the set's contents at creation time and stay isolated from later changes and from each other.
Auto-gradeddesignhash-setiteratorsnapshotDesign a single-class interactive key-value shell that saves to disk, handles bad input, logs errors, accepts new commands easily, and ships with unit tests, a README, and CI.
Model answeroopcliunit-testingpersistenceSimulate an in-memory banking ledger that processes chronologically ordered operations involving balances, leaderboards, delayed cashbacks, and account merges.
Auto-gradeddesign-dsheaps-sortingarraysDesign an in-memory compute credit ledger handling expiring grants, usage subtractions with earliest-expiration priority, out-of-order event ingestion, and point-in-time balance queries.
Model answerdesign-dsheaps-sortinggreedy-intervalsarraysBuild a reconciler that keeps a cached insurance status correct when verification results arrive late, duplicated, or as failures, and that can rebuild the status from full history.
Model answeridempotencyout-of-order eventscache consistencystate reconciliationSimulate a fixed-capacity LRU cache keyed by a call's positional and keyword arguments, with order-insensitive, type-aware key matching.
Auto-gradedlru-cachehash-mapdoubly-linked-listcanonical-keysSimulate concurrent inventory purchases and sales ensuring atomic state updates, preventing negative inventory, and handling invalid operations cleanly.
Auto-gradeddesign-dsarraysconcurrencyDesign an event-driven system to track test statuses, calculate minimum recovery durations, and identify the longest continuous window of high concurrent failures.
Model answerdesign-dsgreedy-intervalsarraysSimulate an event-driven task queue handling execution states, lease timeouts, retry budgets, dependencies, and dead-letter cascading.
Auto-gradeddesign-dsheaps-sortingtrees-graphsstacks-queuesImplement a resilient round-robin request balancer that handles dynamic server membership, followed by a consistent hashing router to maintain key affinity.
Model answerdesign-dshashingconcurrencybinary-searchSimulate a stateful screening service driven by an operation log: whole-token, case-insensitive banned-word checks, replaceable word lists, and per-user flagged-review tallies.
Auto-gradedhash-sethash-mapsimulationstringsIdentify anti-patterns in legacy dispatch assignment code, implement fixes, introduce domain types, and design for thread-safety.
Model answerrefactoringthread-safetyobject-oriented-designclean-codeSimulate a fixed-capacity Least Recently Used (LRU) storage engine that processes lookup and insert operations in O(1) time.
Auto-gradeddesign-dslinked-listsarraysImplement thread-safe Round-Robin and Consistent Hashing balancers supporting health checks and dynamic nodes, then analyze their performance.
Model answerload-balancerconsistent-hashinground-robindata-structure-designDesign 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-mapconcurrency