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 601–630 of 737 results
Design a mutable list with a cursor that stays attached to its element as items are inserted, removed, or relocated within the collection.
Model answerdata-structuresinvariantsapi-designcomplexity-analysisTests state management for a two-layer game board with recursive win detection and dynamic move constraints based on previous plays.
Auto-gradedsimulationgame-theorystate-machineTests linked list deep copying with arbitrary pointers and implementing an LRU cache with O(1) operations using hash maps and doubly-linked lists.
Auto-gradedlinked-listshash-mapdesignpointersImplement a timestamped in-memory ledger supporting deposits, cashback transfers, scheduled execution, account merging with alias resolution, and point-in-time balance queries.
Model answerunion-findheapbinary-searchsimulationImplement two data structures: one supporting fast interval sum queries on a fixed array, and a stack that efficiently tracks and removes its maximum element.
Model answerprefix-sumstackheapdata-structuresTests the ability to simulate a fixed-capacity LRU cache by processing a sequence of get/put operations and collecting all get results in order.
Auto-gradeddata structurescachesimulationImplement a data structure that keeps k randomly chosen items from a stream where you don't know the total count ahead of time.
Model answerreservoir-samplingstreaming-algorithmsrandomized-algorithmsTests ability to use hash maps for constant-time operations and handle state transitions in a key-value store simulation.
Auto-gradedhash-mapsimulationdata-structuresTests your ability to build a versioned data store supporting efficient historical lookups through binary search on sorted timestamps.
Auto-gradedbinary-searchhash-mapdata-structuresDesign a queue interface and implement it using different data structures, analyzing trade-offs between linked lists, arrays, and stacks.
Model answerobject-oriented-designdata-structurestrade-offsDesign a fixed-memory event counter using a ring buffer of per-second buckets that tracks how many events fell inside a trailing 15-minute window.
Auto-gradedring-buffersliding-windowdesignsimulationBuild a complete terminal game where two players secretly place ships on grids, then take turns firing until one fleet is destroyed.
Model answerobject-oriented-designgame-logicinput-validationstate-managementDesign a cart with reversible add/remove operations, tracking change history with undo/redo stacks.
Auto-gradeddata-structuresstackstate-managementTests tree manipulation with parent-child relationships, path reconstruction, and cycle prevention during node relocation.
Auto-gradedtreeshash-mapsgraphscycle-detectionTests understanding of the observer pattern through ordered listener management, callback registration/removal, and event dispatch simulation.
Auto-gradedobserver-patterndata-structuresstate-managementTests ability to design a data structure that supports streaming character appends, point updates, and O(log N) nearest-occurrence queries over a mutable string.
Auto-gradedordered-settreapbinary-search-treedesignTests implementation of an in-memory store combining TTL expiration, a logical clock, and atomic single-transaction semantics with rollback.
Auto-gradedhash-maptransactionssimulationTests ability to design time-windowed event counters with efficient memory management and query performance using sliding-window techniques.
Auto-gradedqueuesliding-windowdata-structure-designTests iterator protocols, lazy evaluation, and memory-efficient buffering for multiple independent consumers reading from a single source stream.
Auto-gradediteratorsgeneratorsmemory-managementTests lazy global offset propagation and min-heap with lazy deletion to efficiently manage counters under bulk increments and minimum extraction.
Auto-gradedheaplazy-propagationdesignTests the ability to maintain an efficient two-heap structure that yields the current median of a growing integer stream in O(log n) per insertion and O(1) per query.
Auto-gradedheaptwo-heapsdata-streammedianTests your ability to implement a data structure that maintains access order and performs lookups, updates, and evictions efficiently.
Auto-gradedhash-maplinked-listcacheordered-dictTests segment tree design for efficiently finding and tracking contiguous free blocks in a memory-like array with logarithmic-time allocation and release operations.
Auto-gradedsegment-treeinterval-managementdata-structure-designTests understanding of least-recently-used eviction by executing a sequence of cache operations and collecting their return values.
Auto-gradedcachelruevictionsimulationDesign and implement a subscription-based event system where functions can subscribe to event identifiers and be invoked when those events are triggered.
Model answerevent-systemcallbackserror-handlingreentrancyCreate a logger that safely accepts messages from multiple threads, buffers them in memory, and writes batches to disk based on size or time triggers.
Model answerconcurrencythreadingproducer-consumerbufferingSimulate a wristband payment system that drains expiring credits before a linked card, applies zone-based surcharges, and splits refunds back across both funding sources.
Model answersimulationpriority-queuestate-managementTests data-structure design for a directed follow graph with copy-on-snapshot history and friend-of-friend recommendations ranked by mutual count.
Auto-gradedhash-mapsimulationdesignModel the board state, movement rules, and win conditions for an asymmetric two-player grid game where geese try to reach the far side while foxes hunt them.
Model answerobject-oriented designgame enginesimulationstate machineImplement a multi-level cache that evicts expired entries, checks tier utilization, and retrieves the highest-weight item from any eligible tier.
Model answerheaplazy-deletionmulti-levelexpiration