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 511–540 of 738 results
Design a notification manager for a book lending system that handles hold queues, checkout allocation, and idempotent due-date alerts.
Model answerheapsimulationidempotencyqueueDesign and incrementally build a card-hand evaluator that ranks hands, resolves ties deterministically, adds new categories, and applies a swappable discard rule.
Model answerobject-oriented designextensibilitygame logicBuild an in-memory file manager that tracks user storage, enforces capacity limits, and evicts largest files when quotas shrink.
Model answerhash-mapheaplazy-deletionquota-managementDesign a data structure that tracks the most-visited URLs over a configurable recent time window, with idempotent inserts and efficient eviction.
Model answersliding-windowheaphash-mapstreamingTests ordered insertion, fee-before-principal payment allocation, and efficient forward-propagation of balance changes when events arrive out of sequence.
Auto-gradedsimulationsorted-insertdata-structure-designTests ability to build a stateful table abstraction that processes insert and query operations with filtering, sorting, and column projection.
Auto-gradeddesignsimulationsortingBuild a container that registers and removes integer keys and returns a uniformly random current key, all in average constant time.
Model answerhash-maparrayrandomizedconstant-timeTests whether you can combine a hash map and ordered structure to implement O(1) get/put with least-recently-used eviction on a bounded cache.
Auto-gradedhash-maplinked-listcachedesignBuild a spreadsheet system that stores values, evaluates formulas referencing other cells, and prevents circular dependencies through pre-write validation.
Auto-gradedgraphdependency-trackingcycle-detectionBuild an in-memory file system tracking per-user storage limits, supporting file operations including duplication, compression, and quota-driven eviction.
Model answerhash-mapheapobject-oriented-designbookkeepingTests building a positional inverted index so that multi-word phrases can be found by exact word sequence across many documents with repeated queries handled efficiently.
Auto-gradedinverted-indexstring-searchhashingDesign a trie-backed file system supporting path-based file insertion and directory listing, with a per-directory capacity cap and OS-style duplicate renaming.
Model answertriehash-mapfile-systemOOPDesign an in-memory cache that enforces capacity with LRU eviction and per-entry TTL, keeping expiration efficient without iterating all keys.
Model answercachelruttlconcurrencyBuild a limit order matching engine, then add participation-rate execution logic for one client, and finally extend to multiple clients with fair allocation.
Model answerorder-bookpriority-queuesimulationgreedyTests ability to build a bottom-up Merkle hash tree from file path/content mappings and use subtree hash pruning to efficiently classify added, modified, and deleted files.
Auto-gradedhashingtrees-graphsrecursionBuild a trie-based URL router that registers templates with named captures and wildcard tails, resolves concrete paths with literal-first precedence and backtracking, and detects shape conflicts.
Model answertrieroutingbacktrackingdesignTests ability to implement a circular buffer with O(1) enqueue/dequeue/peek and correct wraparound, full/empty handling, and ordered iteration.
Auto-gradedcircular-bufferqueuearraysimulationBuild a data structure to efficiently query employee roles and reporting counts in a company hierarchy, then extend it to handle dynamic additions.
Model answertreesgraphspreprocessingaggregationBuild a tokenizer that greedily matches the longest vocabulary token at each position, handling unknown characters with optional span merging.
Model answertriestring-matchingtokenizationgreedy-algorithmsTests stateful simulation with circular iteration, capacity tracking, and toggling availability flags.
Auto-gradedsimulationcircular-iterationstate-managementReplay a scripted sequence of get/put operations against a fixed-capacity LRU cache and return one result per operation.
Auto-gradedlru-cachehash-mapsimulationordered-dictDesign a multiset supporting insert, remove, and uniform random sampling over all occurrences, each in expected O(1) time.
Model answerhash-maparrayrandomnessdata-structure-designEvaluate structured filter expressions with comparison, membership, and logical operators over in-memory records
Auto-gradedrecursiondata-structuresquery-evaluationTests the ability to preprocess data for efficient repeated lookups using hash maps and two-pointer merging of sorted lists.
Auto-gradedhash-maptwo-pointerspreprocessingUsing only flatMap, groupByKey, union, and collect on a minimal RDD class, implement word counting and a duplicate-preserving intersection of two datasets.
Model answerrddword-countmultiset-intersectionFilter a time-ordered stream of log messages to show each distinct message only once per 10-second window
Auto-gradedhash-mapstreamingrate-limitingTests ability to implement a command-driven key-value store with correct upsert, lookup, conditional update, delete, and membership semantics.
Auto-gradedhash-tablesimulationdesignImplement a command history mechanism supporting single edits, grouped operations, and bidirectional traversal through past states.
Model answerundo-redocommand-patternstate-managementImplement a move-only smart pointer and a generic dynamic array in C++, exercising RAII, the Rule of Five, placement new, and exception-safe resizing.
Model answerc++memory-managementraiimove-semanticsDesign and implement a text editor with insert/delete operations, undo/redo history, prefix-based autocomplete with frequency ranking, and multi-user concurrent editing.
Model answerdata-structuresundo-redotrieoperational-transformation