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 211–240 of 362 results

  • Data Structure DesignMediumModel answer
    Concurrent Queue with Bounded Capacity and Graceful Shutdown

    Implement a thread-safe FIFO queue with fixed capacity, blocking operations, timeout support, and coordinated shutdown behavior.

    Data Structure Designconcurrencythreadingsynchronizationmonitor-pattern
  • Data Structure DesignMediumModel answer
    One-Edit Word Lookup and Vertical Tree Traversal

    Design a data structure for single-character substitution queries, then output a binary tree's node values sorted by column, row, and left-to-right order.

    Data Structure Designhashingtriebinary-treebfs
  • Data Structure DesignHardModel answer
    Live Spreadsheet with Eager Caching and Cycle Guards

    Build a spreadsheet engine where every write pre-computes all downstream values so reads are O(1) cache lookups, and circular definitions are rejected atomically.

    Data Structure Designgraphstopological-sortcycle-detectiondependency-tracking
  • Data Structure DesignMediumModel answer
    Build an In-Memory Key-Value Store with Savepoints

    Design a transactional key-value store supporting nested transactions, named savepoints, and full rollback using an undo-log approach.

    Data Structure Designtransactionsundo-logkey-value-storenested-transactions
  • Data Structure DesignMediumModel answer
    Build a FIFO Queue: Compare Linked List, Array, and Ring Buffer

    Implement a queue with enqueue, dequeue, peek, and isEmpty. Compare linked list, dynamic array, and circular buffer approaches.

    Data Structure Designqueuedata-structurescomplexity-analysismemory-management
  • Data Structure DesignMediumModel answer
    Build a Thread-Safe Token Bucket Rate Limiter

    Implement a token bucket that refills lazily on each admission attempt, handles concurrent callers safely, and supports both non-blocking and timeout-bounded acquisition.

    Data Structure Designconcurrencyrate-limitingsynchronization
  • Data Structure DesignMediumModel answer
    Concurrent Data Structures and Calendar Scheduling

    Build thread-safe request throttling, search from scratch, frequency-ranked retrieval, and multi-calendar availability finder.

    Data Structure Designconcurrencydata-structuresalgorithmsscheduling
  • Data Structure DesignMediumModel answer
    Build a Multi-Key Task Queue with Ordering and Concurrency Control

    Create a thread-safe task scheduler that runs tasks sequentially per key while respecting a global worker limit and capacity bound.

    Data Structure Designconcurrencythreadingqueuesynchronization
  • Data Structure DesignMediumModel answer
    Multiset with O(1) Insert, Delete, and Uniform Random Sampling

    Build a collection supporting duplicates with constant-time insertion, deletion, and uniform random selection from all stored occurrences.

    Data Structure Designdata-structureshash-tablesrandomization
  • Data Structure DesignMediumModel answer
    Two-Tier API Rate Limiter with a Sliding Window

    Design a thread-safe rate limiter that enforces both a per-endpoint quota and a shared global quota using a rolling time window.

    Data Structure Designrate-limitingconcurrencysliding-windowthread-safety
  • Data Structure DesignMediumModel answer
    Build a Reference-Counted Shared Ownership Pointer in C++

    Implement a thread-safe shared ownership smart pointer class template from scratch, covering copy/move semantics, atomic reference counting, and correct destruction.

    Data Structure Designc++memory-managementconcurrency
  • Data Structure DesignMediumModel answer
    Dynamic Hierarchy Manager with Timestamp Ordering

    Build a system that processes timestamped parent-child updates arriving in any order, maintains a valid tree structure, and prevents cycles.

    Data Structure Designtreesgraphsstate-managementcycle-detection
  • Data Structure DesignMediumModel answer
    Design a Five-Card Hand Evaluator with Partial Hand Completion

    Model poker-style five-card hands with an abstract type hierarchy, compare two hands by strength and tie-break, then find the strongest and weakest completions of a partial hand.

    Data Structure Designobject-oriented designclassificationcombinatoricscomplexity analysis
  • Data Structure DesignMediumModel answer
    Concurrent Task Execution with Type-Level Exclusion

    Build a synchronization mechanism allowing tasks of the same type to run together while blocking tasks of different types from overlapping.

    Data Structure Designconcurrencythreadingsynchronization
  • Data Structure DesignMediumModel answer
    Defensive Coding: Validate and Harden a Snake Game

    Design an input-validation strategy, error-handling policy, and test suite to protect a Snake game implementation from every class of bad input.

    Data Structure Designvalidationerror-handlingtestingsnake-game
  • Data Structure DesignHardModel answer
    Build a Subscription Pattern Recognition Engine

    Create a system that discovers recurring billing patterns in transaction data, handling merchant name variations, timing drift, and price changes.

    Data Structure Designpattern-recognitiondata-processingheuristics
  • Data Structure DesignMediumModel answer
    Build an In-Memory Promo Code Service

    Design and implement a class that creates, validates, and redeems promotional discount codes with expiry, global and per-user limits, and idempotent retries.

    Data Structure Designhash-mapexpirationidempotencyconcurrency
  • Data Structure DesignMediumModel answer
    Design a Multiset Trie with Fast Prefix Counting

    Build a trie that tracks word multiplicities, supports insertion, deletion, exact and prefix lookup, and handles Unicode safely.

    Data Structure Designtriedata-structuresconcurrencyunicode
  • Data Structure DesignMediumModel answer
    Build a Nested-Transaction Key–Value Store from Scratch

    Design and implement an in-memory key–value store that supports arbitrarily nested BEGIN/COMMIT/ROLLBACK transactions with correct shadowing and O(1) reads.

    Data Structure Designhash-mapstacktransactionsundo-log
  • Data Structure DesignMediumModel answer
    Build a Stack That Also Tracks and Removes the Maximum

    Design a stack supporting push, pop, top, peekMax, and popMax, with two implementations trading off simplicity against O(log n) worst-case popMax.

    Data Structure Designstackheaplinked-listamortized-complexity
  • Data Structure DesignHardModel answer
    Versioned In-Memory Set with Snapshot Iterators and WAL Contracts

    Design an MVCC-backed mutable set with O(1) snapshot iterators and specify the durability, ordering, and crash-recovery contracts for a write-ahead log.

    Data Structure DesignMVCCsnapshot isolationWALdata structure design
  • 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 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 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 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 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