KatInterview

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

Data Structure Design Interview Problems

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

5985
Problems
2218
Auto-graded
15
Topics
271
Added today

Showing 481–510 of 739 results

  • Data Structure DesignMediumAuto-graded
    Score Tracker with Ranking and Top-K Queries

    Tests the ability to maintain ordered scores with efficient updates and rank lookups using augmented balanced search trees.

    Data Structure Designbinary-search-treeorder-statisticsdata-structures
  • Data Structure DesignMediumAuto-graded
    Versioned Key-Value Log with Point-in-Time Reads

    Tests per-key version tracking and efficient predecessor search to retrieve the most recent value written at or before any queried timestamp.

    Data Structure Designbinary searchhash mapversioning
  • Data Structure DesignHardModel answer
    Mutable Integer Set with Freeze-Frame Iterators

    Design an integer set supporting O(1) add/remove/contains plus snapshot iterators that capture insertion-order state at creation time without copying.

    Data Structure Designsnapshotsiteratorsappend-only logversioning
  • Data Structure DesignMediumModel answer
    Build a Path-Addressed Tree Store and a Bounded Ring Buffer

    Design an in-memory hierarchical path store with strict parent-existence errors, plus a fixed-capacity FIFO queue where every operation is constant time.

    Data Structure Designtriehash-mapcircular-bufferapi-design
  • Data Structure DesignMediumAuto-graded
    Access-Tracked Key-Value Store

    Build a dictionary that counts how many times each key has been retrieved, testing hash map design and state management.

    Data Structure Designhash-mapdesignsimulation
  • Data Structure DesignMediumModel answer
    In-Memory Grid with Formula Evaluation and Cycle Guards

    Build a spreadsheet class in three stages: plain integer cells, formula parsing with dependency-order evaluation, then cycle detection and targeted recomputation.

    Data Structure Designgraphsdependency-trackingparsing
  • Data Structure DesignHardModel answer
    Peak Concurrent Couriers Over a Rolling 24-Hour Window

    Design a data structure that records courier delivery intervals and efficiently answers: what is the highest number of couriers simultaneously active at any instant in the last 24 hours?

    Data Structure Designsegment-treeintervalssliding-windowonline-algorithms
  • Data Structure DesignMediumAuto-graded
    Round-Robin Load Balancer with Capacity and Shutdown

    Tests stateful system simulation with round-robin target selection, connection lifecycle tracking, capacity enforcement, and target shutdown with eviction ordering.

    Data Structure Designsimulationhash-tableround-robinstateful
  • Data Structure DesignMediumAuto-graded
    Disjoint Set: Merge Nodes and Query Connectivity

    Tests ability to implement Union-Find with union by rank and path compression, supporting merge, connectivity, and component-count queries.

    Data Structure Designunion-finddisjoint-setgraphdata-structure-design
  • Data Structure DesignHardModel answer
    Building Map and Filter from a Reduce Foundation

    Implement a reduce operation, then express map and filter purely in terms of that reducer without independent iteration.

    Data Structure Designhigher-order-functionsfunctional-programmingdata-structures
  • Data Structure DesignHardAuto-graded
    IP Access Control with CIDR Matching

    Tests binary trie implementation for efficient IP prefix matching with CIDR notation and rule subsumption optimization.

    Data Structure Designtriebit-manipulationnetwork-programming
  • Data Structure DesignMediumModel answer
    Build a Dropping Tile Game with Win Detection

    Implement game logic for a gravity-based two-player board game: handle piece placement, detect wins efficiently, and analyze complexity.

    Data Structure Designgame-logic2d-gridstate-machine
  • Data Structure DesignMediumModel answer
    Build a Type-Aware Key-Value Store from First Principles

    Design a hash map that supports keys and values of arbitrary types, covering hashing contracts, equality semantics, collision resolution, and memory ownership.

    Data Structure Designhash-maptype-erasurecollision-resolutionmemory-management
  • Data Structure DesignMediumModel answer
    Generate Unique Character Profiles with Attribute Rules

    Build a generator that creates N character profiles from trait pools, enforcing no-duplicates, uniqueness, and dependency rules between attributes.

    Data Structure Designbacktrackingconstraint-satisfactionalgorithms
  • Data Structure DesignMediumAuto-graded
    Parcel Attribute Store with TTL and Prefix Queries

    Simulate a timestamped key-value attribute store with overwrite, conditional update, sorted prefix listing, and per-attribute expiry.

    Data Structure Designhash-mapsimulationsortingexpiry
  • Data Structure DesignMediumAuto-graded
    Replayable Library Lending Operations

    Simulate a book catalog with case-insensitive title/author search and atomic borrow/return state transitions replayed from an operation log.

    Data Structure Designhash-mapsimulationstring-matchingstate-machine
  • Data Structure DesignHardAuto-graded
    Rolling-Window Chat Activity Tracker

    Build a bounded-memory sliding-window aggregator answering distinct-chat, distinct-user, and message-total queries from an operation log in amortized O(1).

    Data Structure Designsliding-windowdequehash-mapreference-counting
  • Data Structure DesignMediumAuto-graded
    Billing Reconciliation: Match Payments to Invoices in Three Stages

    Tests incremental lookup design by matching payments to invoices via explicit ID, then earliest-dated exact-amount fallback, then a forgiveness range, with closed-invoice tracking throughout.

    Data Structure Designhash-mapheapsegment-tree
  • Data Structure DesignMediumModel answer
    Build a Collapsible JSON Tree Renderer in React

    Create a React component that parses a JSON string and displays it as an interactive, expandable tree structure.

    Data Structure Designreactrecursioncomponent-designstate-management
  • Data Structure DesignEasyAuto-graded
    Build a Fixed-Capacity Recency-Ordered Cache

    Tests whether you can design a cache that evicts the least-recently-touched entry in O(1) time using a hash map paired with an ordered structure.

    Data Structure Designhash-maplinked-listcacheOrderedDict
  • Data Structure DesignMediumAuto-graded
    Unified Entity Log with Mergeable ID Groups

    Tests ability to design a data structure that resolves multiple system-assigned IDs to a single entity and returns a chronologically merged observation history.

    Data Structure Designunion-finddesignsorting
  • Data Structure DesignMediumAuto-graded
    Two-Way Link Mapper: Shorten and Restore URLs

    Tests ability to design a bidirectional hash map structure that assigns stable short identifiers to long URLs and retrieves originals in O(1).

    Data Structure Designhash-mapdesignstrings
  • Data Structure DesignMediumModel answer
    Build a Weighted Consistent Hash Ring

    Design and code a hash ring that maps keys to servers with virtual nodes, supporting weighted capacity and minimal key movement on topology changes.

    Data Structure Designhashingdistributed-systemsdata-structuresbinary-search
  • Data Structure DesignMediumModel answer
    Dependency-Aware Job Scheduler with Priority Queues

    Build an in-memory scheduler that tracks job prerequisites, selects the next runnable job by a four-field priority rule, supports filtered queries, and detects deadlocks.

    Data Structure Designheaptopological-sortgraphsimulation
  • Data Structure DesignMediumModel answer
    Continuous-Batch Inference Loop with Slot Refilling

    Implement a dynamic batching generation loop that keeps a fixed-size batch full by refilling completed slots from a waiting queue until all requests are served.

    Data Structure Designbatchinginferencesimulationqueue
  • Data Structure DesignMediumModel answer
    Model a Prepaid Spending Account with Transaction Limits

    Design a class hierarchy that tracks a spending cap, running balance, and transaction history while safely handling concurrent charges and edge-case inputs.

    Data Structure Designobject-oriented designconcurrencystate managementPython
  • Data Structure DesignMediumModel answer
    Fix a Broken Round-Robin Load Balancer

    Debug and repair a round-robin router that mis-assigns requests when servers are added, removed, or marked unhealthy, then write tests covering the edge cases.

    Data Structure Designround-robinload-balancingdebuggingconcurrency
  • Data Structure DesignMediumAuto-graded
    Simulate a Bounded Cache That Forgets the Least-Used Entry

    Tests O(1) design of a fixed-size recency-ordered cache: correct eviction order, recency refresh on reads and writes, and update-without-evict semantics.

    Data Structure Designhash-maplinked-listcachedesign
  • Data Structure DesignMediumAuto-graded
    Order State Machine with Transition Validation

    Tests finite state machine implementation with strict transition rules and rejection of invalid state changes.

    Data Structure Designstate-machinevalidationdata-structures
  • Data Structure DesignMediumAuto-graded
    Variable Registry With Deep Reference Expansion and Cycle Detection

    Tests recursive variable substitution with memoization, cycle detection across direct and indirect references, and clean handling of undefined variable references.

    Data Structure Designstringsrecursionhash-mapcycle-detection