KatInterview

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

Data Structure Design Interview Problems

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

5972
Problems
2212
Auto-graded
15
Topics
273
Added today

Showing 631–660 of 737 results

  • Data Structure DesignMediumAuto-graded
    Circular Buffer with Fixed Capacity

    Tests implementation of a bounded FIFO queue using circular array indexing with constant-time operations.

    Data Structure Designqueuecircular-bufferarraydata-structure-design
  • Data Structure DesignEasyAuto-graded
    Execute Turn-Based Movement Commands on a Line

    Tests state tracking and rule validation for alternating player moves on a bounded one-dimensional board.

    Data Structure Designsimulationstate-machinevalidation
  • Data Structure DesignMediumModel answer
    Firewall Rule Engine with Prefix Matching

    Build a rule-based IP filter supporting CIDR blocks, priority resolution, and efficient queries for single IPs and prefix ranges.

    Data Structure Designtrienetworkingbit-manipulation
  • Data Structure DesignMediumAuto-graded
    Compute Credit Ledger with Expiration

    Implement an in-memory ledger that manages time-limited credits with priority expiration and debt tracking.

    Data Structure Designheappriority-queuesimulation
  • Data Structure DesignMediumModel answer
    Transactional Key-Value Store with Rollback Support

    Build a key-value store supporting nested transactions with set, get, delete, begin, commit, and rollback operations.

    Data Structure Designtransactionsstackstate-managementkey-value-store
  • Data Structure DesignEasyAuto-graded
    Multi-User File System with Snapshots and Account Consolidation

    Build an in-memory file storage system with per-user quotas, global file uniqueness, ranked retrieval, account merging, and atomic snapshot restore.

    Data Structure Designhash-mapsimulationdata-structure-design
  • Data Structure DesignMediumAuto-graded
    Incremental Entropy Tracker for Categorical Streams

    Build a data structure that efficiently computes Shannon entropy after each new categorical observation arrives.

    Data Structure Designstreamingentropyincremental-computation
  • Data Structure DesignMediumAuto-graded
    Request Quota Tracker with Rolling Time Windows

    Tests your ability to track request counts per user within a sliding time window using efficient data structures.

    Data Structure Designsliding-windowqueuerate-limiting
  • Data Structure DesignMediumModel answer
    Finding Consecutive Duplicates in Subarrays

    Design data structures to efficiently detect sequences of identical elements in an array and answer queries about their presence in suffixes.

    Data Structure Designarray-scanningpreprocessingrange-queries
  • Data Structure DesignMediumAuto-graded
    Build a Fixed-Size Cache That Forgets the Least-Used Entry

    Tests your ability to combine a hash map and an ordered structure to implement O(1) reads and writes with recency-based eviction.

    Data Structure Designhash-maplinked-listcachedesign
  • Data Structure DesignMediumModel answer
    Build a Policy Engine for Expense Validation

    Create a rule evaluation system that checks expense submissions against JSON-defined policies without deploying new code.

    Data Structure Designdata-structuresparsingvalidation
  • Data Structure DesignMediumModel answer
    Data Structure Selection: Complexity and Trade-offs

    Analyze time and space complexity for standard data structures and explain when to use each based on access patterns and constraints.

    Data Structure Designdata-structurescomplexity-analysistrade-offs
  • Data Structure DesignMediumModel answer
    Complete Concrete Classes in an Abstract Base Hierarchy

    Implement missing methods in concrete subclasses that inherit from abstract base classes while maintaining type safety and LSP compliance.

    Data Structure Designobject-oriented-designinheritanceabstractiondesign-patterns
  • Data Structure DesignMediumAuto-graded
    Flatten and Filter a Nested Configuration Tree

    Tests the ability to write an iterator-style traversal over arbitrarily nested dicts and lists to extract leaf values matching a type filter.

    Data Structure Designdata structuresrecursioniteratorsnested data
  • Data Structure DesignMediumAuto-graded
    Simulate a Price-Level Tracker for Buy and Sell Orders

    Tests your ability to combine a hash map with a lazy-deletion heap to track best bid and ask prices across a sequence of order book operations.

    Data Structure Designheaphash-maplazy-deletionsimulation
  • Data Structure DesignMediumModel answer
    Build a Flexible Tennis Game Score Tracker

    Create a scoring system for a single tennis game that records points, displays readable scores, detects game completion, and supports multiple rule variants.

    Data Structure Designobject-oriented-designstrategy-patternstate-management
  • Data Structure DesignMediumModel answer
    Lottery Bucket with Constant-Time Operations and Duplicates

    Build a data structure supporting O(1) add, remove, and uniform random selection where duplicate entries are treated as separate items.

    Data Structure Designhash-tablearrayrandomizationduplicates
  • Data Structure DesignMediumModel answer
    Hierarchical Task Tracker: OO Domain Model & Service Layer

    Design and implement an object-oriented model for a nested task manager with status propagation, recursive deletion, and attribute-based filtering.

    Data Structure Designobject-oriented designtree traversalAPI designcomposite pattern
  • Data Structure DesignMediumModel answer
    Dense-Index Data Structure Code Review

    Review a structure storing items under contiguous integer keys with O(1) random selection and removal while preserving index density.

    Data Structure Designcode-reviewdata-structuresrandomizationcomplexity-analysis
  • Data Structure DesignMediumModel answer
    Greedy Card Selection with Dynamic Deck State

    Simulate a threshold-based card selection strategy that accounts for a shrinking deck, tracking which cards remain available after each decision.

    Data Structure Designfenwick-treegreedysimulationbinary-indexed-tree
  • Data Structure DesignEasyAuto-graded
    Track User Votes with Deduplication

    Tests ability to maintain stateful vote tracking with idempotent operations and bounded history retrieval

    Data Structure Designhash-tablestate-managementdeduplication
  • Data Structure DesignMediumModel answer
    Area-Weighted Random Point Sampling Across Multiple Squares

    Design a class for uniform random point sampling inside a square, then extend it to sample uniformly from the union of N non-overlapping squares.

    Data Structure Designprobabilityprefix-sumssamplinggeometry
  • Data Structure DesignHardModel answer
    Build an Idempotent Financial Account System

    Create an in-memory account manager that enforces balance rules, prevents duplicate processing via transaction IDs, and detects conflicting retries.

    Data Structure Designfinancial-systemsidempotencydata-structuresstate-management
  • Data Structure DesignHardAuto-graded
    Time-Versioned Key-Value Storage

    Implement a data structure that stores versioned values by timestamp and retrieves the most recent version at or before a query time.

    Data Structure Designbinary-searchhash-mapdata-structures
  • Data Structure DesignMediumAuto-graded
    Process Account Transaction Sequence

    Tests ability to implement stateful operations on indexed data with validation, edge-case handling, and multiple operation types.

    Data Structure Designsimulationvalidationstate-management
  • Data Structure DesignHardModel answer
    Design a Thread-Safe Resource Pool with RAII Handles

    Build a concurrent object pool in C++ that safely manages reusable resources with blocking acquisition, automatic return via RAII, and graceful shutdown.

    Data Structure Designconcurrencyc++raiithread-safety
  • Data Structure DesignMediumAuto-graded
    Compute Dot Products for Memory-Efficient Integer Vectors

    Tests efficient sparse data representation using hash maps and optimizing operations by focusing on non-zero elements only.

    Data Structure Designhash-mapsparse-dataoptimization
  • Data Structure DesignMediumModel answer
    Call Channel State Manager

    Build a stateful manager that allows exactly one active two-party call at a time, with proper validation and error handling.

    Data Structure Designstate-machineobject-oriented-designvalidationexceptions
  • Data Structure DesignHardAuto-graded
    Simulate a TTL-Aware LFU Cache with Frequency Snapshots

    Tests ability to simulate a multi-operation Least-Frequently-Used cache that evicts expired entries by TTL and breaks ties by recency, while supporting frequency-snapshot queries.

    Data Structure Designdata structurescachesimulation
  • Data Structure DesignMediumModel answer
    Build a Fee Calculator with Comprehensive Test Coverage

    Write a service class that computes fees based on business rules, then extend it and write unit tests covering normal cases, boundaries, and errors.

    Data Structure Designtestingvalidationobject-oriented-design