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 1–30 of 737 results
Design a concurrent transfer operation over an in-memory account store that never loses updates, is all-or-nothing, preserves total money, and cannot deadlock.
Model answerconcurrencylockingdeadlockatomicityExplain how abstract base classes work in Python and how instance, class and static methods differ in binding, inheritance behavior and typical use.
Model answerpythonoopabstract-classesclassmethodDebug and implement stateful body rewind logic for seekable file-like streams when executing HTTP 307 redirects in an HTTP client library.
Model answerpythonhttpdebuggingstreamsProcess a batch of operations that load travel records and answer per-user point-in-time location queries using grouping, sorting and binary search.
Auto-gradedbinary-searchhash-mapintervalsdesignSimulate a stream of operations that assigns sessions to the lowest-numbered free room and reports the top-k streams by total duration, tested with heaps and lazy deletion.
Auto-gradedheapdesignsimulationlazy-deletionArchitect an object-oriented Blackjack engine handling multi-deck shoes, split hands, and soft/hard total calculations.
Model answerData Structure DesignObject-Oriented DesignState MachineProcess a batch of hit and query operations, returning each caller's number of hits within an inclusive 300-second window, using per-caller queues with lazy expiry.
Auto-gradedhash-mapqueuesliding-windowsimulationSimulate a best-fit memory manager on a fixed address range, handling splits, exact-start frees, invalid frees, and merging of neighboring free blocks using plain lists.
Auto-gradedsimulationbinary-searchmemory-allocatorbest-fitDesign and code a Pillow-based batch tool that grayscales and shrinks images, then scale it to many large files with multiprocessing, robust error handling, bounded memory and benchmarks.
Model answerpythonpillowmultiprocessingconcurrencySimulate a sequence of allocate and release operations on independent categories, always handing out the smallest free positive integer, using a counter plus a min-heap per category.
Auto-gradedheaphash-mapsimulationdesignImplement an in-memory key-value database supporting frequency counting and nested transaction rollbacks.
Auto-gradedhash-tablestackdesigndata-structuresProcess a series of operations on an in-memory key-value store with fixed time-to-live expiration dynamics.
Auto-gradeddesign-dshash-tableDesign a concurrency controller that manages exclusive access to two distinct targets while preventing deadlocks and invalid release calls.
Model answerconcurrencymultithreadinglockssynchronizationReview a Java cache built on LinkedHashMap that evicts the wrong entries, find each defect, write minimal failing tests, and produce a corrected version.
Model answerlru-cachejavalinkedhashmapdebuggingSimulate driver registration and dispatch operations using standard queue processing and state tracking.
Auto-gradeddata-structuresqueueshash-tablesimulationProcess dynamic creation of compressed vectors and compute inner products using sparse representations.
Auto-gradedarraysdesign-dshash-tableSimulate operations on a custom key-value map that efficiently queries the most recently updated active entry.
Auto-gradeddesign-dslinked-listsarraysBuild a decorator that audits a chunked file-reading generator's lifecycle, with deterministic file cleanup on completion, early exit, errors and garbage collection.
Model answerpythongeneratorsdecoratorscontext-managersCritique a Python function that caches expensive results in a dict, then make it thread-safe so each input is computed once, without blocking cache hits or unrelated inputs.
Model answerpythonconcurrencycachinglockingSimulate a stateful iterator that lazily combines two strictly sorted sequences into a single sorted, duplicate-free stream using constant space.
Auto-gradeddesign-dsarraysheaps-sortingSimulate a word store that answers pattern queries where '.' stands for any single letter, which is best handled with a prefix tree and a depth-aware traversal.
Auto-gradedtriedesignwildcarddfsDesign a memory-efficient real-time streaming data structure to query moving averages over a sliding temporal window.
Auto-gradedsliding-windowdequedesignstream-processingBuild an in-memory directed follow graph with cheap snapshots, historical edge lookups, and a friends-of-friends suggestion ranking with id tie-breaks.
Model answergraphsnapshotsbinary-searchheapProcess a sequence of point winners for a single tennis game and print the correct score after each point, including deuce, advantage and the win-by-two rule.
Model answersimulationstate-designclass-designedge-casesSimulate an in-memory banking system processing sequential operations, pending transfers with fixed-window expiration, and account activity tracking.
Auto-gradedData StructuresSimulationDesignHash TableSimulate a two-creature duel with fixed speed order, a minimum-damage floor, and a type-advantage multiplier, then return the winner's name.
Auto-gradedsimulationdictionariesfloating-pointgame-logicBuild an in-memory string map in C++ that can dump its full state to a byte buffer and rebuild it, handling arbitrary bytes, corrupt input, and failed restores safely.
Model answerserializationbinary-formathash-mapinput-validationSimulate an in-memory banking system handling accounts, balances, scheduled payments via a priority queue, and account merges.
Auto-gradedheaphash-tablesimulationdesign-dsDesign an in-memory, thread-safe ledger that upserts delivery records and serves instant per-courier earnings and per-client invoice totals in integer cents.
Model answerconcurrencyhash-mapincremental-aggregationlow-level-designImplement an in-memory CSV query processor with auto-type inference and polymorphic field filtering.
Model answerparsingdesign-dsstringsarrays