KatInterview

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

Data Structure Design Interview Problems

Practice 5979 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.

5979
Problems
2215
Auto-graded
15
Topics
273
Added today

Showing 181–210 of 376 results

  • 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
  • Data Structure DesignMediumAuto-graded
    Subtree Totals Under Collapse and Graft Operations

    Maintain per-node totals in a rooted tree while nodes are collapsed into leaves or have a subtree grafted onto a leaf, answering total queries after each change.

    Data Structure Designtreehash-mapsimulationparent-pointers
  • Data Structure DesignMediumAuto-graded
    Alive-Node Graph Simulator with Gated Edge Insertion

    Simulate a sequence of node toggles, edge edits, and connectivity queries on an undirected graph where only alive nodes count and edges are only added between alive endpoints.

    Data Structure Designunion-findgraphsimulationconnected-components
  • Data Structure DesignMediumAuto-graded
    Nearest Working Charger: Command Simulator with Great-Circle Math

    Process a batch of commands on a charging-station registry, with status updates, spherical distance and nearest-online lookups that break ties deterministically.

    Data Structure Designdesignsimulationhaversinesorting
  • Data Structure DesignMediumAuto-graded
    Recency-Evicting Store Simulation Plus Graph Group Tally

    Simulate a fixed-size recency-evicting key-value store from a command log, and separately count connected groups in an undirected graph, returning both results together.

    Data Structure Designlru-cachehash-mapordered-dictunion-find
  • Data Structure DesignMediumAuto-graded
    Subtree Earnings Ledger with Ranked Threshold Queries

    Simulate a command sequence on a referral forest, maintaining subtree revenue totals and answering ranked queries filtered by a strict threshold.

    Data Structure Designhash-maptreesimulationsorting
  • Data Structure DesignMediumAuto-graded
    Replay Operations on a Skip-Ahead Iterator

    Simulate a forward-only iterator that yields every k-th element, with an idempotent has-next check, and return the results of a scripted sequence of operations.

    Data Structure Designiteratorsimulationstate-managementdesign
  • Data Structure DesignMediumAuto-graded
    Parcel Runner Payout Ledger with Peak Overlap Queries

    Simulate a stateful ledger driven by operation lists: track per-runner payout sums and compute maximum simultaneous half-open intervals clipped to a query window.

    Data Structure Designsweep-linehash-mapintervalssimulation
  • Data Structure DesignMediumAuto-graded
    Batch Runner for a Slash-Separated Key Store

    Simulate a hierarchical key store from a batch of create/get commands, where a key can only be created once its parent key already exists.

    Data Structure Designdesignhash-maptriesimulation
  • Data Structure DesignMediumAuto-graded
    Healthy Region Registry and Nearest-Site Router

    Simulate a command interpreter that registers sites, toggles their health, and answers nearest-healthy-site queries by great-circle distance, with strict validation and tie-breaking.

    Data Structure Designsimulationstring-parsinghash-mapvalidation
  • Data Structure DesignEasyAuto-graded
    Most Likely Follower Lookup Over Streaming Sentences

    Process a stream of add and query operations over sentences, tracking adjacent-word counts and returning the most frequent follower with lexicographic tie-breaking.

    Data Structure Designhash-mapstringssimulationcounting
  • Data Structure DesignMediumAuto-graded
    Weighted Prefix Suggestion Engine via Command Replay

    Replay a list of add and search commands on a weighted word store, returning the top-k prefix matches ranked by weight, then alphabetically.

    Data Structure Designtrieprefix-searchheaphash-map
  • Data Structure DesignMediumAuto-graded
    Replay a Log on a Budgeted Recency Cache

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

    Data Structure Designlru-cacheordered-dicthash-mapsimulation
  • Data Structure DesignMediumAuto-graded
    Fleet Billing Ledger With Time-Dated Per-Minute Rates

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

    Data Structure Designdesignsimulationbinary-searchdecimal-arithmetic
  • Data Structure DesignMediumAuto-graded
    Three Mini Simulations: Case Folding, Aligned Allocator, Run Counter

    Solve three independent simulations: case-insensitive adjacent changes, an 8-aligned memory allocator, and online counting of same-color runs on a line.

    Data Structure Designsimulationstringshash-mapstate-maintenance
  • Data Structure DesignMediumAuto-graded
    Square Grid Line-Completion Referee

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

    Data Structure Designdesignsimulationcountingmatrix
  • Data Structure DesignMediumAuto-graded
    LRU Store with Rolling Mean Over Recent Writes

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

    Data Structure Designlru-cachehash-mapdequesliding-window
  • Data Structure DesignEasyAuto-graded
    Replay Ledger Commands on a Guarded Account

    Simulate an account that processes a list of deposit, withdraw, balance and history commands, rejecting invalid amounts and overdrafts while recording only successful transactions.

    Data Structure Designsimulationclass-designstate-managementvalidation
  • Data Structure DesignMediumAuto-graded
    Admit or Deny Requests Under a Per-Client Rolling Quota

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

    Data Structure Designsliding-windowdequehash-mapsimulation
  • Data Structure DesignMediumAuto-graded
    Live Ranking Board for Sponsored Listings

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

    Data Structure Designheaphash-maplazy-deletiondesign
  • Data Structure DesignEasyAuto-graded
    Ledger Replay: Deposits, Withdrawals and Percentage Rewards

    Simulate a single account balance across a sequence of operations, silently rejecting invalid ones, and report the balance after each step.

    Data Structure Designsimulationstate-managementvalidationfloating-point
  • Data Structure DesignMediumAuto-graded
    Nested Message Schema: Size and Field Type Queries

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

    Data Structure Designparsinghash-maprecursionmemoization
  • Data Structure DesignEasyAuto-graded
    Sorted Buffer Simulator with Insert and Snapshot Commands

    Simulate a container that keeps integers in ascending order under insert and snapshot commands, testing binary-search insertion, duplicate handling, and copying versus aliasing.

    Data Structure Designbinary-searchsimulationsorted-listdesign
  • Data Structure DesignMediumAuto-graded
    Dual-Quota Request Throttle with Sliding Time Window

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

    Data Structure Designsliding-windowdequehash-mapsimulation
  • Data Structure DesignMediumAuto-graded
    Bidirectional Walk Over a CIDR Block's Addresses

    Simulate a two-way cursor over the IPv4 addresses of a CIDR block using integer arithmetic, with exact boundary and no-move-on-failure rules.

    Data Structure Designiteratorbit-manipulationcidrsimulation
  • Data Structure DesignMediumAuto-graded
    Count Lower Readings in a Trailing Time Window

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

    Data Structure Designsliding-windowbinary-searchsimulationstreaming
  • Data Structure DesignMediumAuto-graded
    Spreadsheet Cells With Sum Formulas and Loop Detection

    Simulate a command list on a spreadsheet whose cells hold integers or two-reference sum formulas, evaluating lazily and reporting circular references.

    Data Structure Designgraphdfscycle-detectionsimulation
  • Data Structure DesignMediumAuto-graded
    Most Likely Follower Lookup via Operation Log

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

    Data Structure Designhash-mapdesigncountingsimulation
  • Data Structure DesignMediumAuto-graded
    Restaurant Queue Tracker with Fast Rank Lookup

    Replay a list of queue operations on a first-come waitlist, supporting add, remove-by-id, rank lookup and front peek, with rank queries faster than a linear scan.

    Data Structure Designdesignorder-statistictreaphash-map
  • Data Structure DesignMediumAuto-graded
    Multiset Frequency Log with Lazy Snapshot Pool Top-K

    Simulate insert, remove and top-k queries on a multiset using a snapshot pool whose stale entries are discarded lazily, testing hash maps with heaps and exact rule-following.

    Data Structure Designhash-mapheaplazy-deletiondesign