KatInterview

practice a little every day — you've got this ♡

Data Structure Design Interview Problems

Practice 5976 original coding, SQL, system design, machine learning and behavioral problems across 15 topics. Coding and SQL problems run against hidden test cases right in your browser; every problem has hints and a worked solution, free.

5976
Problems
2213
Auto-graded
15
Topics
271
Added today

Showing 151–180 of 375 results

  • Data Structure DesignMediumAuto-graded
    Execute Sequence of LRU Cache Instructions

    Simulate a Least Recently Used (LRU) cache supporting fast lookups, insertions, updates, and capacity evictions across a series of operations.

    Data Structure Designhash-tabledoubly-linked-listdesign
  • Data Structure DesignMediumAuto-graded
    Serialize and Split Key-Value Store Payload

    Encodes a dictionary mapping string keys to string values into a binary protocol payload and splits it into fixed-size byte chunks.

    Data Structure Designencodingbinarystringsdesign-ds
  • Data Structure DesignEasyAuto-graded
    Replay a Command Script and Record Box State After Each Step

    Simulate an ordered list of color, delay and move commands on a box, tracking cumulative position and total waited time, and return a state snapshot after every command.

    Data Structure Designsimulationstate-machinearraysmethod-chaining
  • Data Structure DesignMediumAuto-graded
    Aggregate Executed Call Sequences across Threads

    Simulate an execution stream aggregator tracking stack call frequency across threads with custom tie-breaking rules.

    Data Structure Designdesign-dsarrayshash-table
  • Data Structure DesignMediumAuto-graded
    Replay Path Insertions and Filename Lookups on a Component Trie

    Simulate an in-memory path trie driven by a list of add and search operations, with iterative traversal, path normalization, and exact rules for what counts as a file.

    Data Structure Designtrietree-traversaliterative-dfssimulation
  • Data Structure DesignMediumAuto-graded
    Replay a Bounded Recency Store from an Operation Log

    Simulate a fixed-size key-value store that discards the least recently touched entry when full, by replaying a log of operations and returning each result.

    Data Structure Designhash-maplinked-listsimulationcache
  • Data Structure DesignMediumAuto-graded
    Quota-Limited Storage Simulator with Staging and Snapshots

    Simulate a per-user file store with staged uploads, quota checks, ranked prefix queries, and atomic snapshot restores under two conflict policies.

    Data Structure Designdesignhash-mapsimulationsorting
  • Data Structure DesignMediumAuto-graded
    Sliding-Window Leaderboard Replay Simulator

    Simulate a class that logs timestamped events and reports the K most frequent IDs in a closed time window, with out-of-order events and queries.

    Data Structure Designdesignbinary-searchhash-mapsorting
  • Data Structure DesignMediumAuto-graded
    Versioned Network Edge Tracker

    Process a stream of edge insertions, snapshot triggers, and historical adjacency queries for a dynamic graph.

    Data Structure Designdesign-dsarraystrees-graphs
  • Data Structure DesignHardAuto-graded
    Design a Custom Key-Value Map

    Execute a series of map operations (put, get, remove) by simulating a hash map without using built-in dictionaries or sets.

    Data Structure Designarraysdesign-dshash-table
  • Data Structure DesignEasyAuto-graded
    Rolling Ten-Minute Error Counter by Endpoint Prefix

    Replay 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.

    Data Structure Designdesignbinary-searchhash-mapsliding-window
  • Data Structure DesignMediumAuto-graded
    Typo-Tolerant Word Lookup with One Edit

    Answer batches of lookups against a fixed word list, returning every word within Levenshtein distance 1 of the query, using a deletion-based hash index.

    Data Structure Designhash-mapedit-distancestringsindexing
  • Data Structure DesignEasyAuto-graded
    Simulate a Constant-Time LRU Eviction Cache

    Process a series of lookup and insert requests on a fixed-size Least Recently Used (LRU) key-value cache in O(1) time per operation.

    Data Structure Designdesign-dslinked-listsarrays
  • Data Structure DesignEasyAuto-graded
    Most Frequent Follower Lookup with Command Replay

    Simulate 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.

    Data Structure Designhash-mapdesignstringssimulation
  • Data Structure DesignMediumAuto-graded
    Simulate 2048 Moves with Scripted Tile Spawns

    Simulate 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.

    Data Structure Designsimulationmatrixstate-managementdeterministic-testing
  • Data Structure DesignMediumAuto-graded
    Simulate a Tiny Hierarchical File Store from a Command Log

    Replay a command log against an in-memory directory tree, with auto-created parent folders, file appends, reads and sorted listings.

    Data Structure Designdesigntrietreehash-map
  • Data Structure DesignMediumAuto-graded
    Hierarchical Storage Simulator with Auto-Renamed Duplicates

    Simulate an in-memory directory tree with auto-created folders, numbered duplicate file names that respect extensions, content lookup, and sorted listings.

    Data Structure Designdesignhash-mapstring-parsingsimulation
  • Data Structure DesignHardAuto-graded
    Cache, Quota Gate and Burst Counter: Batch Operation Runner

    Simulate a batch of operations on an O(1) LFU cache, a fixed-window per-user quota check, and a two-pointer peak request counter.

    Data Structure Designlfu-cacheordered-dictrate-limitingtwo-pointers
  • Data Structure DesignHardAuto-graded
    Interactive Time Calendar with Pagination and Range Queries

    Process dynamic interval updates, range queries, and ordered pagination operations efficiently.

    Data Structure Designtrees-graphsdesign-dsgreedy-intervals
  • Data Structure DesignMediumAuto-graded
    Identify Winning Move in Bottom-Inserted Drop Game

    Simulate a custom grid game with bottom-insertion pushes to detect the earliest turn that forms a line of length k.

    Data Structure Designarrayshash-tablesimulationdesign-ds
  • Data Structure DesignMediumAuto-graded
    Replay a Bounded Recency Store from an Operation Log

    Simulate 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.

    Data Structure Designhash-mapdoubly-linked-listlru-cachesimulation
  • Data Structure DesignMediumAuto-graded
    Run a Command Log on a Recency Cache with Live Mean

    Simulate a fixed-capacity least-recently-used cache from a command log, answering lookups and the mean of stored values, each in expected constant time.

    Data Structure Designlru-cachehash-mapdoubly-linked-listrunning-sum
  • Data Structure DesignMediumAuto-graded
    Evaluate Nested Comparison Rules Over a List of Records

    Evaluate 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.

    Data Structure Designrecursiontree-evaluationfilteringvalidation
  • Data Structure DesignMediumAuto-graded
    Simulate a Bounded Recency-Evicting Key-Value Store

    Replay 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.

    Data Structure Designlru-cachehash-maplinked-listsimulation
  • Data Structure DesignEasyAuto-graded
    Bunk Allocation by Preferred Room Size

    Match students to rooms by hard size preference in input order, respecting capacity, keeping partially filled rooms, and reporting students who could not be placed.

    Data Structure Designqueuessimulationhash-mapgreedy
  • Data Structure DesignMediumAuto-graded
    Command-Driven Ledger with Transfer Volume Leaderboard

    Simulate an in-memory ledger from text commands, with validated transfers and a leaderboard ranked by outgoing volume with an alphabetical tie-break.

    Data Structure Designhash-mapsimulationsortingstring-parsing
  • Data Structure DesignMediumAuto-graded
    Simulate a Topic Message Broker with Subscription Tokens

    Simulate a topic-based message broker from a command log, handling token issuance, ordered delivery records, and idempotent unsubscribes.

    Data Structure Designdesignhash-mapsimulationordering
  • Data Structure DesignMediumAuto-graded
    Work Queue Tracker with Owners, Closing, and Late Lookups

    Simulate a task tracker driven by a list of operations, handling creation, reassignment, completion, and multi-key sorted queries while returning one result per operation.

    Data Structure Designdesignhash-mapsortingsimulation
  • Data Structure DesignMediumAuto-graded
    Per-Key Cooldown Filter for a Timestamped Event Feed

    Walk a time-ordered event feed and decide which events pass a 10-second per-key cooldown, where only accepted events restart the cooldown.

    Data Structure Designhash-mapsimulationrate-limitingstreams
  • Data Structure DesignMediumAuto-graded
    Funding Ledger with Rail-Specific Settlement and Window Caps

    Simulate an ordered account ledger where each payment rail has its own settlement delay, cutoff-shifted window assignment, and per-window cap, and output the combined results.

    Data Structure Designsimulationhash-mapheapdesign