Topic
Data Structure Design interview problems
Caches, iterators, rate limiters and custom containers. 739 original problems, each with hidden test cases you can run in the browser.
53 easy589 medium97 hard
Showing 451–480 of 739 results
Tests dictionary aggregation, deterministic ordering, and building cumulative totals along two dimensions from grouped records.
Auto-gradedaggregationdictionariesdata-processingImplement a queue with enqueue, dequeue, peek, and isEmpty. Compare linked list, dynamic array, and circular buffer approaches.
Model answerqueuedata-structurescomplexity-analysismemory-managementTests trie-style prefix counting logic via operation replay, with optional case-insensitive and trailing-digit normalization flags.
Auto-gradedtriestringssimulationTests whether a candidate can design a two-heap structure that inserts integers and queries the running median in better than O(N) time per operation.
Auto-gradedheapsdesignstreamingTests ability to implement a pipeline of filter, multi-column sort, and column projection over a list of in-memory row dicts.
Auto-gradeddata structuressortingfilteringImplement a token bucket that refills lazily on each admission attempt, handles concurrent callers safely, and supports both non-blocking and timeout-bounded acquisition.
Model answerconcurrencyrate-limitingsynchronizationSimulate a capacity-limited key–value cache where lookups and writes both refresh recency and the oldest entry is evicted on overflow.
Auto-gradedhash-maplinked-listcachesimulationBuild thread-safe request throttling, search from scratch, frequency-ranked retrieval, and multi-calendar availability finder.
Model answerconcurrencydata-structuresalgorithmsschedulingCreate a thread-safe task scheduler that runs tasks sequentially per key while respecting a global worker limit and capacity bound.
Model answerconcurrencythreadingqueuesynchronizationSimulate setting and reading spreadsheet cells whose values are integers or sums of references, evaluating lazily and rejecting updates that would form cycles.
Auto-gradedgraphscycle-detectionexpression-evaluationdependency-trackingBuild a collection supporting duplicates with constant-time insertion, deletion, and uniform random selection from all stored occurrences.
Model answerdata-structureshash-tablesrandomizationDesign a thread-safe rate limiter that enforces both a per-endpoint quota and a shared global quota using a rolling time window.
Model answerrate-limitingconcurrencysliding-windowthread-safetyImplement a thread-safe shared ownership smart pointer class template from scratch, covering copy/move semantics, atomic reference counting, and correct destruction.
Model answerc++memory-managementconcurrencyTests the ability to design an in-memory ledger class driven by an operation list, maintaining running cost totals and an idempotent pay-cutoff pointer.
Auto-gradeddesignsimulationhash-mapImplement a key-value store where each write increments a global version counter and reads retrieve values by version using binary search.
Auto-gradedbinary-searchdata-structuresversioningBuild a system that processes timestamped parent-child updates arriving in any order, maintains a valid tree structure, and prevents cycles.
Model answertreesgraphsstate-managementcycle-detectionModel poker-style five-card hands with an abstract type hierarchy, compare two hands by strength and tie-break, then find the strongest and weakest completions of a partial hand.
Model answerobject-oriented designclassificationcombinatoricscomplexity analysisBuild a synchronization mechanism allowing tasks of the same type to run together while blocking tasks of different types from overlapping.
Model answerconcurrencythreadingsynchronizationTests ability to implement a doubly-linked list supporting sequential iteration and non-mutating element-wise transformation via a command-driven simulation.
Auto-gradedlinked-listiterator-patternhigher-order-functionsDesign an input-validation strategy, error-handling policy, and test suite to protect a Snake game implementation from every class of bad input.
Model answervalidationerror-handlingtestingsnake-gameTests whether you can design a cache that evicts the least recently accessed entry in O(1) time by combining a hash map with an ordered structure.
Auto-gradedhash-maplinked-listdesigncacheCreate a system that discovers recurring billing patterns in transaction data, handling merchant name variations, timing drift, and price changes.
Model answerpattern-recognitiondata-processingheuristicsDesign and implement a class that creates, validates, and redeems promotional discount codes with expiry, global and per-user limits, and idempotent retries.
Model answerhash-mapexpirationidempotencyconcurrencyBuild a trie that tracks word multiplicities, supports insertion, deletion, exact and prefix lookup, and handles Unicode safely.
Model answertriedata-structuresconcurrencyunicodeTests incremental win detection on an m×n board by tracking consecutive run lengths at endpoints to check for k-in-a-row in O(1) per move.
Auto-gradeddesignarrayssimulationDesign and implement an in-memory key–value store that supports arbitrarily nested BEGIN/COMMIT/ROLLBACK transactions with correct shadowing and O(1) reads.
Model answerhash-mapstacktransactionsundo-logDesign a stack supporting push, pop, top, peekMax, and popMax, with two implementations trading off simplicity against O(log n) worst-case popMax.
Model answerstackheaplinked-listamortized-complexityDesign an MVCC-backed mutable set with O(1) snapshot iterators and specify the durability, ordering, and crash-recovery contracts for a write-ahead log.
Model answerMVCCsnapshot isolationWALdata structure designTests inverted index design and set-based matching to efficiently find which registered word patterns are satisfied by incoming events.
Auto-gradedhash-tablessetsinverted-indexBuild a cache that tracks access counts and evicts the least-used item, breaking ties by recency, all in constant time.
Auto-gradedhash-mapdoubly-linked-listcachedesign