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 481–510 of 739 results
Tests the ability to maintain ordered scores with efficient updates and rank lookups using augmented balanced search trees.
Auto-gradedbinary-search-treeorder-statisticsdata-structuresTests per-key version tracking and efficient predecessor search to retrieve the most recent value written at or before any queried timestamp.
Auto-gradedbinary searchhash mapversioningDesign an integer set supporting O(1) add/remove/contains plus snapshot iterators that capture insertion-order state at creation time without copying.
Model answersnapshotsiteratorsappend-only logversioningDesign an in-memory hierarchical path store with strict parent-existence errors, plus a fixed-capacity FIFO queue where every operation is constant time.
Model answertriehash-mapcircular-bufferapi-designBuild a dictionary that counts how many times each key has been retrieved, testing hash map design and state management.
Auto-gradedhash-mapdesignsimulationBuild a spreadsheet class in three stages: plain integer cells, formula parsing with dependency-order evaluation, then cycle detection and targeted recomputation.
Model answergraphsdependency-trackingparsingDesign a data structure that records courier delivery intervals and efficiently answers: what is the highest number of couriers simultaneously active at any instant in the last 24 hours?
Model answersegment-treeintervalssliding-windowonline-algorithmsTests stateful system simulation with round-robin target selection, connection lifecycle tracking, capacity enforcement, and target shutdown with eviction ordering.
Auto-gradedsimulationhash-tableround-robinstatefulTests ability to implement Union-Find with union by rank and path compression, supporting merge, connectivity, and component-count queries.
Auto-gradedunion-finddisjoint-setgraphdata-structure-designImplement a reduce operation, then express map and filter purely in terms of that reducer without independent iteration.
Model answerhigher-order-functionsfunctional-programmingdata-structuresTests binary trie implementation for efficient IP prefix matching with CIDR notation and rule subsumption optimization.
Auto-gradedtriebit-manipulationnetwork-programmingImplement game logic for a gravity-based two-player board game: handle piece placement, detect wins efficiently, and analyze complexity.
Model answergame-logic2d-gridstate-machineDesign a hash map that supports keys and values of arbitrary types, covering hashing contracts, equality semantics, collision resolution, and memory ownership.
Model answerhash-maptype-erasurecollision-resolutionmemory-managementBuild a generator that creates N character profiles from trait pools, enforcing no-duplicates, uniqueness, and dependency rules between attributes.
Model answerbacktrackingconstraint-satisfactionalgorithmsSimulate a timestamped key-value attribute store with overwrite, conditional update, sorted prefix listing, and per-attribute expiry.
Auto-gradedhash-mapsimulationsortingexpirySimulate a book catalog with case-insensitive title/author search and atomic borrow/return state transitions replayed from an operation log.
Auto-gradedhash-mapsimulationstring-matchingstate-machineBuild a bounded-memory sliding-window aggregator answering distinct-chat, distinct-user, and message-total queries from an operation log in amortized O(1).
Auto-gradedsliding-windowdequehash-mapreference-countingTests incremental lookup design by matching payments to invoices via explicit ID, then earliest-dated exact-amount fallback, then a forgiveness range, with closed-invoice tracking throughout.
Auto-gradedhash-mapheapsegment-treeCreate a React component that parses a JSON string and displays it as an interactive, expandable tree structure.
Model answerreactrecursioncomponent-designstate-managementTests whether you can design a cache that evicts the least-recently-touched entry in O(1) time using a hash map paired with an ordered structure.
Auto-gradedhash-maplinked-listcacheOrderedDictTests ability to design a data structure that resolves multiple system-assigned IDs to a single entity and returns a chronologically merged observation history.
Auto-gradedunion-finddesignsortingTests ability to design a bidirectional hash map structure that assigns stable short identifiers to long URLs and retrieves originals in O(1).
Auto-gradedhash-mapdesignstringsDesign and code a hash ring that maps keys to servers with virtual nodes, supporting weighted capacity and minimal key movement on topology changes.
Model answerhashingdistributed-systemsdata-structuresbinary-searchBuild an in-memory scheduler that tracks job prerequisites, selects the next runnable job by a four-field priority rule, supports filtered queries, and detects deadlocks.
Model answerheaptopological-sortgraphsimulationImplement a dynamic batching generation loop that keeps a fixed-size batch full by refilling completed slots from a waiting queue until all requests are served.
Model answerbatchinginferencesimulationqueueDesign a class hierarchy that tracks a spending cap, running balance, and transaction history while safely handling concurrent charges and edge-case inputs.
Model answerobject-oriented designconcurrencystate managementPythonDebug and repair a round-robin router that mis-assigns requests when servers are added, removed, or marked unhealthy, then write tests covering the edge cases.
Model answerround-robinload-balancingdebuggingconcurrencyTests O(1) design of a fixed-size recency-ordered cache: correct eviction order, recency refresh on reads and writes, and update-without-evict semantics.
Auto-gradedhash-maplinked-listcachedesignTests finite state machine implementation with strict transition rules and rejection of invalid state changes.
Auto-gradedstate-machinevalidationdata-structuresTests recursive variable substitution with memoization, cycle detection across direct and indirect references, and clean handling of undefined variable references.
Auto-gradedstringsrecursionhash-mapcycle-detection