KatInterview

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

Data Structure Design Interview Problems

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

5980
Problems
2215
Auto-graded
15
Topics
272
Added today

Showing 211–240 of 738 results

  • Data Structure DesignMediumModel answer
    Build an In-Memory File Store with Quotas and Backups

    Implement an in-memory file store with prefix top-N queries, per-user quotas, user merging, and per-user backup and restore that never disturb other users.

    Data Structure Designdata-structure-designhash-mapheapin-memory-storage
  • Data Structure DesignMediumModel answer
    Reversible Wallet Balance Tracker with Undo and Redo

    Design an in-memory wallet class that applies relative changes and absolute resets to an integer-cent balance, with full undo and redo and constant-time operations.

    Data Structure Designdesignundo-redostackscommand-pattern
  • Data Structure DesignMediumModel answer
    Review a Fit/Transform Preprocessing Module and Write a Key Test

    Review a small Python preprocessing module with an outlier-capping class and three imputers: explain its purpose, justify fit/transform separation, critique style and imports, and write one key unit test.

    Data Structure Designpythoncode-reviewscikit-learnunit-testing
  • Data Structure DesignMediumAuto-graded
    Replay-Safe Versioned Record Updates Simulator

    Simulate a record store that applies updates with optimistic version checks and per-record idempotency keys, replaying cached results for retries and rejecting reused keys.

    Data Structure Designdesignhash-mapidempotencyoptimistic-concurrency
  • Data Structure DesignMediumModel answer
    Single-Open Async Tooltip Panels with Keyboard Support in React

    Design a React popover that fetches data when opened, stays exclusive across many triggers, ignores stale responses, and handles focus, Esc, and outside clicks accessibly.

    Data Structure Designreactaccessibilityrace-conditionsfocus-management
  • Data Structure DesignMediumAuto-graded
    Nested Transaction Log for an In-Memory Dictionary

    Simulate a key-value store with nested begin, commit and rollback by replaying a command list and recording each read result.

    Data Structure Designhash-mapstacktransactionsundo-log
  • Data Structure DesignMediumModel answer
    Pluggable Scoring Pipeline for Ranking Concert and Show Listings

    Design an object-oriented ranking engine where scoring and filtering rules can be chained, weighted, reordered and isolated from failures, with a backfill tier when too few results come back.

    Data Structure Designobject-oriented-designstrategy-patternrankingfallback
  • Data Structure DesignMediumModel answer
    Build a CSV Data Frame and Assembly of Sequence Fragments

    Parse RFC 4180 CSV into an in-memory table with query support, and reconstruct chained sequences from directed or undirected overlapping fragments.

    Data Structure Designdesign-dsstringstrees-graphs
  • Data Structure DesignMediumAuto-graded
    Replay a Typing Session Against a Ranked Suggestion History

    Simulate keystroke-by-keystroke search suggestions over a frequency-weighted history that grows as queries are committed, ranking the top 3 matches by count and then text.

    Data Structure Designhash-mapdesignstring-prefixtop-k
  • Data Structure DesignMediumModel answer
    Build a Bucketed Spatial Index for Planar Points

    Implement a region quadtree that stores 2D points in capacity-limited buckets, splits into four quadrants on overflow, and answers rectangular range queries efficiently.

    Data Structure Designquadtreespatial-indexrecursionrange-query
  • Data Structure DesignMediumModel answer
    Build a Bounded Permit Task Execution Engine

    Implement a concurrency manager that controls variable permit usage per task, supports blocking and asynchronous execution, and guarantees safe permit releases.

    Data Structure Designconcurrencysynchronizationdesign-dsthreading
  • Data Structure DesignMediumModel answer
    Build a Biased Index Picker Using Cumulative Totals

    Design a class that returns an index at random with probability proportional to its weight, then explain how to make each draw fast and how to handle updates.

    Data Structure Designprefix-sumbinary-searchrandom-samplingfenwick-tree
  • Data Structure DesignMediumModel answer
    Trailing-Day Campaign CTR over Two Skewed Event Feeds

    Build a generator that emits per-campaign impression, click and CTR figures over a trailing 24-hour window, counting one click per impression and accepting events up to 10 minutes late.

    Data Structure Designstreamingsliding-windowheaphash-map
  • Data Structure DesignMediumModel answer
    Proportional Random Index Picker with Fast Repeated Queries

    Design a class that returns a random index with probability proportional to its weight, optimized for many repeated draws after one-time setup.

    Data Structure Designprefix-sumsbinary-searchrandom-samplingfenwick-tree
  • Data Structure DesignMediumAuto-graded
    Design an In-Memory Reservation Manager

    Implement an in-memory venue reservation system supporting quick seat allocation, cancellation tracking, and capacity queries.

    Data Structure Designhash-tabledesignstacksdata-structures
  • Data Structure DesignMediumModel answer
    Const Pointer Variants and Choosing Between Tree and Hash Maps in C++

    Explain how const placement changes pointer and pointee mutability in C++, then compare std::map and std::unordered_map on structure, complexity, ordering, key needs and use cases.

    Data Structure Designcppconst-correctnesspointersstd-map
  • Data Structure DesignHardModel answer
    Build a Jungle Board Game Engine with Class Hierarchies

    Design the classes for a two-player Jungle (Dou Shou Qi) engine: eight animals, a 9x7 board with water, traps and dens, capture and jump rules, a small API, and tests.

    Data Structure Designobject-oriented-designgame-enginepolymorphismclass-design
  • Data Structure DesignMediumModel answer
    Build a Keyed Task Dispatcher with Global Concurrency Cap

    Design a component that runs tasks in strict order per key, lets different keys run in parallel up to a global limit, and stays correct under concurrent submits and task failures.

    Data Structure Designconcurrencythread-safetyexecutorqueues
  • Data Structure DesignMediumAuto-graded
    Chat Activity Tracker with a Rolling 15-Minute Window

    Simulate a chat activity tracker with a closed rolling window, touch/close liveness rules, and out-of-order events, using bounded-memory eviction.

    Data Structure Designdesignhash-mapheapsliding-window
  • Data Structure DesignMediumModel answer
    Random Equipment Lending Pool with Constant-Time Operations

    Build an in-memory pool that lends out a uniformly random free item to a borrower, accepts returns, and allows retirement of idle items, with every operation in O(1) average time.

    Data Structure Designhash-maprandomizedswap-and-popinsert-delete-getrandom
  • Data Structure DesignMediumAuto-graded
    Design a Dispatch Queue for Autonomous Taxi Requests

    Simulate an event-driven dispatching system that maintains pending requests ordered by pickup time and processes state updates efficiently using heaps and hash maps.

    Data Structure Designheaphash-tabledesignsorting
  • Data Structure DesignHardAuto-graded
    Leftmost-Fit Block Reservation with Owner Release

    Simulate a storage pool that reserves the leftmost run of contiguous free cells per request and releases everything an owner holds, using efficient free-run tracking.

    Data Structure Designsegment-treesimulationinterval-merginghash-map
  • Data Structure DesignMediumAuto-graded
    Tally Unique Words Using Your Own Open-Addressing Table

    Count unique strings in a list by building a custom hash table with probing, without using built-in sets, dictionaries, or similar lookup containers.

    Data Structure Designhash-tableopen-addressingstringshashing
  • Data Structure DesignMediumModel answer
    Design a Phone-Style Calculator in the Browser

    Build a four-function calculator UI with immediate-execution semantics, tricky key sequences handled correctly, and a layout close to a familiar mobile calculator.

    Data Structure Designstate-machinefrontendjavascriptedge-cases
  • Data Structure DesignMediumAuto-graded
    Sliding Window Score Monitor for Support Chats

    Process a stream of score updates and queries, returning the rolling average and maximum over the latest score of each chat inside a half-open time window.

    Data Structure Designsliding-windowhash-mapqueuelazy-deletion
  • Data Structure DesignEasyModel answer
    Log a Button's Label on Click with the DOM Event API

    Wire up a click handler on a page button that logs its label to the console, and explain what the event object's target property refers to, including nested-element cases.

    Data Structure Designjavascriptdomevent-handlingfrontend-fundamentals
  • Data Structure DesignMediumAuto-graded
    Rolling Mean of Payload Lengths Over a 60-Second Event Window

    Process a stream of checksummed events with duplicates and out-of-order timestamps, reporting a running average payload length over a 60-second window using a queue, a set and a running sum.

    Data Structure Designdequesliding-windowhash-setstreaming
  • Data Structure DesignEasyModel answer
    Immutable Folder Tree State with Safe Move and Delete

    Design a normalized, immutable state model for a nested folder tree and implement add, move (with cycle rejection) and recursive delete efficiently for deep trees.

    Data Structure Designtreestate-managementimmutabilitycycle-detection
  • Data Structure DesignMediumAuto-graded
    Track Busiest Processing Node in Rotating Allocation System

    Simulate round-robin package allocation across nodes with cycle resets, capacity limits, and permanent node shutdowns.

    Data Structure Designarraysdesign-dssimulation
  • Data Structure DesignMediumModel answer
    Task Scheduling Order and Undoable Command Pipeline

    Resolve prerequisite-constrained task sequences with cycle detection, then construct an extensible Command pattern system with state rollback functionality.

    Data Structure Designtrees-graphsdesign-dsstacks-queues