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 301–330 of 739 results
Process a stream of edge insertions, snapshot triggers, and historical adjacency queries for a dynamic graph.
Auto-gradeddesign-dsarraystrees-graphsExecute a series of map operations (put, get, remove) by simulating a hash map without using built-in dictionaries or sets.
Auto-gradedarraysdesign-dshash-tableReplay a log of error-recording and alert-check operations, grouping errors by URL prefix and counting those in an inclusive 600-second window against a strict threshold.
Auto-gradeddesignbinary-searchhash-mapsliding-windowDesign an in-memory cloud billing system supporting delayed cashback rebates, account consolidation, point-in-time historical balance queries, and spend leaderboards.
Model answerData Structure DesignHeapUnion FindBinary SearchWrite a React hook that fetches and reshapes API data with loading, error and refetch support, then connect a modal, a collapsible list and action buttons to component state.
Model answerreacthooksuseEffectasyncAnswer batches of lookups against a fixed word list, returning every word within Levenshtein distance 1 of the query, using a deletion-based hash index.
Auto-gradedhash-mapedit-distancestringsindexingProcess a series of lookup and insert requests on a fixed-size Least Recently Used (LRU) key-value cache in O(1) time per operation.
Auto-gradeddesign-dslinked-listsarraysImplement a resource-managing connection pool wrapper that enforces pool limits, reuses idle connections, and handles lease lifecycles safely.
Model answerdesign-dsobject-oriented-designresource-managementconcurrencySimulate a train/predict command stream for a word-follower model, precomputing the top follower per word so each prediction is a single hash lookup, with a precise tie-break rule.
Auto-gradedhash-mapdesignstringssimulationSimulate a 4x4 sliding-tile merge game with scripted spawns, skipping spawns on no-op moves, then report the final board and whether any move remains.
Auto-gradedsimulationmatrixstate-managementdeterministic-testingBuild a bus network simulator: downsample riders by origin-destination pair, board and drop under a capacity cap, validate event logs, and give priority-pass riders precedence.
Model answersimulationheapstratified-samplingevent-orderingReplay a command log against an in-memory directory tree, with auto-created parent folders, file appends, reads and sorted listings.
Auto-gradeddesigntrietreehash-mapSimulate an in-memory directory tree with auto-created folders, numbered duplicate file names that respect extensions, content lookup, and sorted listings.
Auto-gradeddesignhash-mapstring-parsingsimulationSimulate a batch of operations on an O(1) LFU cache, a fixed-window per-user quota check, and a two-pointer peak request counter.
Auto-gradedlfu-cacheordered-dictrate-limitingtwo-pointersBuild a complete two-player Connect Four game on a 6x7 grid, including drop mechanics, win/draw state evaluation, edge-case prevention, and modular state architecture.
Model answerArraysGame DesignState ManagementData StructuresExplain how you would profile and speed up an existing multithreaded C++ service whose thread pool and queue are given, covering memory, cache, contention, and verification.
Model answercppperformanceconcurrencyprofilingProcess dynamic interval updates, range queries, and ordered pagination operations efficiently.
Auto-gradedtrees-graphsdesign-dsgreedy-intervalsSimulate a custom grid game with bottom-insertion pushes to detect the earliest turn that forms a line of length k.
Auto-gradedarrayshash-tablesimulationdesign-dsDesign and implement a concurrent background scheduler that manages recurring execution intervals, supports execution cancellation, and handles thread-safe termination.
Model answerconcurrencyheapsthreadsdesignDesign an extensible object-oriented engine that drops ineligible events with pluggable rules, then orders the rest by a weighted blend of scoring strategies.
Model answerobject-oriented-designstrategy-patternopen-closed-principlesortingSimulate a fixed-size store that discards its stalest entry on overflow, answering lookups in O(1) each by pairing a hash map with a doubly linked list.
Auto-gradedhash-mapdoubly-linked-listlru-cachesimulationDesign a filesystem duplicate finder that guards against infinite loops, avoids loading whole files into memory, and applies multi-stage filtering to minimize disk reads.
Model answerfilesystemhashingio-optimizationtraversalWrite a thread-safe per-user token-bucket throttle and a small topic-based event broadcaster that stays correct under concurrency and survives failing listeners.
Model answerrate-limitingtoken-bucketpub-subconcurrencySimulate timed, discrete-event message propagation across a satellite graph and fire report callbacks in exact time and ID order.
Model answertrees-graphsheaps-sortingdesign-dsImplement a thread-safe pool that lazily creates up to N connections, reuses healthy ones, blocks callers with a deadline when exhausted, and shuts down cleanly.
Model answerconcurrencythread-safetycondition-variableresource-poolSimulate a fixed-capacity least-recently-used cache from a command log, answering lookups and the mean of stored values, each in expected constant time.
Auto-gradedlru-cachehash-mapdoubly-linked-listrunning-sumBuild a fixed-capacity cache with O(1) lookup, update and eviction by recency, then make it safe for many threads and state exactly what consistency it guarantees.
Model answerlru-cachehash-mapdoubly-linked-listconcurrencyEvaluate a nested rule tree of greater-than, less-than, AND and OR nodes against records, keeping matches in order and treating missing or mismatched fields as false.
Auto-gradedrecursiontree-evaluationfilteringvalidationDesign and implement an in-memory key-value store structured as a file system tree supporting create, set, get, and cascade delete operations with path validation.
Model answerdesign-dstrees-graphsstringsReplay a batch of get/put commands against a fixed-capacity store that discards its least recently used key on overflow, with O(1) average cost per command.
Auto-gradedlru-cachehash-maplinked-listsimulation