KatInterview

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

Data Structure Design Interview Problems

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

5988
Problems
2219
Auto-graded
15
Topics
271
Added today

Showing 361–390 of 739 results

  • Data Structure DesignMediumModel answer
    Frequency-Ranked Shuffle Without Repeats Per Round

    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.

    Data Structure Designheaplazy-deletionhash-mapdesign
  • 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 DesignHardModel answer
    Pattern Router for Sensor Topics with Placeholders and a Tail Wildcard

    Design a router that maps dot-separated topics to registered patterns with named placeholders and a trailing "**", using strict left-to-right precedence and backtracking.

    Data Structure Designtriebacktrackingroutingpattern-matching
  • 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 DesignMediumModel answer
    Live-Streaming Prompt Box with Incremental Reply Rendering

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

    Data Structure Designfrontendreactstreamingasync-state
  • 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 DesignMediumModel answer
    Pointers vs References in C++: Semantics and API Design

    Contrast C++ raw pointers with references, choose the right parameter and return types for four trading-engine APIs, and explain how aliasing affects optimization.

    Data Structure Designcpppointersreferencesapi-design
  • Data Structure DesignMediumModel answer
    Python Deep Dive: Concurrency, Generators, Typing and Memory

    Nine-part Python fundamentals review covering the GIL, concurrency models, decorators, generators, typing, packaging, profiling, memory management and exceptions.

    Data Structure Designpythongilconcurrencygenerators
  • 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 DesignMediumModel answer
    Resilient Chargeback Inbox: Normalize, Cache, and Cancel in React

    Build a React dispute list that normalizes inconsistent API data, caches queries for 60 seconds, and avoids stale responses when filters or search change quickly.

    Data Structure Designreacttypescriptcachingrace-conditions
  • Data Structure DesignHardModel answer
    Eagerly Cached Cell Grid with Dependency Tracking

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

    Data Structure Designgraphtopological-sortcycle-detectioncaching
  • Data Structure DesignEasyModel answer
    Layered Scopes for a Key-Value Store with Savepoints

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

    Data Structure Designstackhash-mapdesignscoping
  • Data Structure DesignMediumModel answer
    Run Work Items on Manual Python Threads and Debug Them in Linux

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

    Data Structure Designpythonthreadingconcurrencylinux
  • 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 DesignMediumModel answer
    Fixing a Lost-Update Race in a Deposit Method You Cannot Edit

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

    Data Structure Designconcurrencyrace-conditionmutexpython
  • 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 DesignHardModel answer
    Retroactive Pay Ledger with Rate Changes and Shift Logging

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

    Data Structure Designdesignprefix-sumbinary-searchintervals
  • Data Structure DesignMediumModel answer
    Org Chart Inference with Manager and Peer Links

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

    Data Structure Designunion-finddesigngraphstransitive-closure
  • 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 DesignMediumModel answer
    Card Prefix Registry with Per-Field Trust Resolution

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

    Data Structure Designhash-maplongest-prefix-matchtriedata-structure-design