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 361–390 of 739 results
Build a player that ingests users' song lists and serves songs from most to least popular, never repeating a song until every known song has played once in the round.
Model answerheaplazy-deletionhash-mapdesignReplay a list of add and search commands on a weighted word store, returning the top-k prefix matches ranked by weight, then alphabetically.
Auto-gradedtrieprefix-searchheaphash-mapSimulate a least-recently-used cache whose budget is the sum of per-entry sizes, replaying an operation log and returning each result, using hashing plus recency ordering.
Auto-gradedlru-cacheordered-dicthash-mapsimulationDesign a router that maps dot-separated topics to registered patterns with named placeholders and a trailing "**", using strict left-to-right precedence and backtracking.
Model answertriebacktrackingroutingpattern-matchingSimulate a bike-fleet billing ledger where each ride is priced at the rate active at its start, with rate changes, duplicate ride ids and an exact total.
Auto-gradeddesignsimulationbinary-searchdecimal-arithmeticSolve three independent simulations: case-insensitive adjacent changes, an 8-aligned memory allocator, and online counting of same-color runs on a line.
Auto-gradedsimulationstringshash-mapstate-maintenanceDesign and code a small front-end component that sends a prompt, renders a streamed reply as it arrives, blocks duplicate sends, supports cancel, and shows loading and error states.
Model answerfrontendreactstreamingasync-stateProcess a batch of moves on an n x n two-player grid and report after each move whether the mover has completed a full row, column, or diagonal, using constant-time per-move bookkeeping.
Auto-gradeddesignsimulationcountingmatrixSimulate a batch of operations on an LRU key-value store that also tracks a rolling mean of the last k written values, with O(1) per operation.
Auto-gradedlru-cachehash-mapdequesliding-windowSimulate an account that processes a list of deposit, withdraw, balance and history commands, rejecting invalid amounts and overdrafts while recording only successful transactions.
Auto-gradedsimulationclass-designstate-managementvalidationContrast C++ raw pointers with references, choose the right parameter and return types for four trading-engine APIs, and explain how aliasing affects optimization.
Model answercpppointersreferencesapi-designNine-part Python fundamentals review covering the GIL, concurrency models, decorators, generators, typing, packaging, profiling, memory management and exceptions.
Model answerpythongilconcurrencygeneratorsProcess a time-ordered request log and decide per request whether a client is under its quota in a rolling time window, counting only previously admitted requests.
Auto-gradedsliding-windowdequehash-mapsimulationBuild a React dispute list that normalizes inconsistent API data, caches queries for 60 seconds, and avoids stale responses when filters or search change quickly.
Model answerreacttypescriptcachingrace-conditionsBuild a grid of cells that stores integers or sum formulas, keeps every value precomputed for constant-time reads, and refuses any write that would introduce a circular reference.
Model answergraphtopological-sortcycle-detectioncachingBuild an in-memory key-value store whose writes can be grouped into nested, revertable scopes that either merge into the enclosing scope or are thrown away.
Model answerstackhash-mapdesignscopingFan a function out over a list using a fixed number of hand-made Python threads, capture every result or error, join cleanly, then inspect the live threads from the Linux shell.
Model answerpythonthreadingconcurrencylinuxProcess a batch of insert, delete and top-k operations on scored items, keeping a live ranking with in-place score updates and deterministic tie-breaking.
Auto-gradedheaphash-maplazy-deletiondesignSimulate a single account balance across a sequence of operations, silently rejecting invalid ones, and report the balance after each step.
Auto-gradedsimulationstate-managementvalidationfloating-pointParse a mini protobuf-style schema from text, then answer batched size and field-type queries with nested messages, forward references, and cycle and error handling.
Auto-gradedparsinghash-maprecursionmemoizationSimulate a container that keeps integers in ascending order under insert and snapshot commands, testing binary-search insertion, duplicate handling, and copying versus aliasing.
Auto-gradedbinary-searchsimulationsorted-listdesignDiagnose the race in an account deposit that reads, pauses, then writes, and add locking through a subclass, wrapper or embedding in Python and Go without touching the original type.
Model answerconcurrencyrace-conditionmutexpythonSimulate a throttle that enforces a per-user and a per-game quota over a sliding time window, recording a request only when both quotas have room.
Auto-gradedsliding-windowdequehash-mapsimulationSimulate a two-way cursor over the IPv4 addresses of a CIDR block using integer arithmetic, with exact boundary and no-move-on-failure rules.
Auto-gradediteratorbit-manipulationcidrsimulationDesign a class that records rate changes and shifts in any order, and reports total earnings under the current rate schedule using prefix sums and binary search.
Model answerdesignprefix-sumbinary-searchintervalsDesign a structure that records manager and same-manager links between employee IDs and answers whether one employee sits above another, including facts inferred from earlier updates.
Model answerunion-finddesigngraphstransitive-closureSimulate a sequence of record and query operations over a timestamped stream, counting readings in a trailing window that are strictly lower than the latest reading.
Auto-gradedsliding-windowbinary-searchsimulationstreamingSimulate a command list on a spreadsheet whose cells hold integers or two-reference sum formulas, evaluating lazily and reporting circular references.
Auto-gradedgraphdfscycle-detectionsimulationSimulate a bigram next-word model from an operation log, returning the most frequent follower with lexicographic tie-breaking and an empty string when none exists.
Auto-gradedhash-mapdesigncountingsimulationDesign an in-memory registry mapping digit prefixes to brand and card type, resolving each field by longest prefix, then trust, then recency, with fast lookups.
Model answerhash-maplongest-prefix-matchtriedata-structure-design