KatInterview

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

Coding 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 271–300 of 651 results

  • Trees & GraphsMediumModel answer
    Evaluate Grid Path Feasibility and Identify Top K Elements

    Determine matrix path reachability under obstacle constraints and extract the k most frequent elements from an array.

    Trees & Graphstrees-graphsheaps-sortingarrays
  • Data Structure DesignMediumModel answer
    Pluggable Filter and Scoring Pipeline for Ticket Listings

    Design an extensible object-oriented engine that drops ineligible events with pluggable rules, then orders the rest by a weighted blend of scoring strategies.

    Data Structure Designobject-oriented-designstrategy-patternopen-closed-principlesorting
  • Data Structure DesignMediumModel answer
    Detect Duplicate Files Safely and Efficiently

    Design a filesystem duplicate finder that guards against infinite loops, avoids loading whole files into memory, and applies multi-stage filtering to minimize disk reads.

    Data Structure Designfilesystemhashingio-optimizationtraversal
  • StringsMediumModel answer
    Fix a Buggy Python Table-to-CSV Function

    Audit a short Python function that flattens rows into CSV text, list its correctness and performance flaws with triggering inputs, and rewrite it safely and efficiently.

    Stringscode-reviewcsvpythonstring-building
  • Data Structure DesignMediumModel answer
    Build a Per-User Throttle and an In-Memory Event Broadcaster

    Write a thread-safe per-user token-bucket throttle and a small topic-based event broadcaster that stays correct under concurrency and survives failing listeners.

    Data Structure Designrate-limitingtoken-bucketpub-subconcurrency
  • Data Structure DesignMediumModel answer
    Simulate Message Spreading in an Orbital Network

    Simulate timed, discrete-event message propagation across a satellite graph and fire report callbacks in exact time and ID order.

    Data Structure Designtrees-graphsheaps-sortingdesign-ds
  • Data Structure DesignMediumModel answer
    Build a Bounded, Thread-Safe Resource Pool with Timeouts

    Implement a thread-safe pool that lazily creates up to N connections, reuses healthy ones, blocks callers with a deadline when exhausted, and shuts down cleanly.

    Data Structure Designconcurrencythread-safetycondition-variableresource-pool
  • Data Structure DesignMediumModel answer
    Concurrent Least-Recently-Used Cache with Constant-Time Operations

    Build a fixed-capacity cache with O(1) lookup, update and eviction by recency, then make it safe for many threads and state exactly what consistency it guarantees.

    Data Structure Designlru-cachehash-mapdoubly-linked-listconcurrency
  • Data Structure DesignMediumModel answer
    Build an In-Memory Hierarchical File System with CRUD Support

    Design and implement an in-memory key-value store structured as a file system tree supporting create, set, get, and cascade delete operations with path validation.

    Data Structure Designdesign-dstrees-graphsstrings
  • Data Structure DesignHardModel answer
    Per-User Rolling Quota Gate with Concurrent Access

    Design a thread-safe class that caps how many requests each user may make in any trailing time interval, avoiding the burst problem of fixed windows, with sub-linear cost per check.

    Data Structure Designrate-limitersliding-windowdequeconcurrency
  • Data Structure DesignHardModel answer
    Escalation Counters and Level Changes in a Review Pipeline

    Design a cached repeat-alert counter that triggers rejection of a work order, then extend it so an alert's severity can change without corrupting counts or past decisions.

    Data Structure Designcachingidempotencyconcurrencyversioning
  • Math & Bit ManipulationEasyModel answer
    Timed Reasoning Quiz: Sequences, Cycles and Grammar Gaps

    Answer three short reasoning items (number sequence, repeating symbols, sentence completion) and explain a time-boxed strategy for a 50-item, 15-minute screen with no wrong-answer penalty.

    Math & Bit Manipulationaptitudepattern-recognitionmodular-arithmetictime-management
  • Trees & GraphsMediumModel answer
    Traverse a Concurrent Dependency Graph with Rate Control and Retries

    Discover the full transitive dependency graph of a package using sequential BFS and concurrent worker pools with retry handling and exact termination logic.

    Trees & Graphstrees-graphsdesign-dsstacks-queuesconcurrency
  • Data Structure DesignMediumModel answer
    Design an Extensible Boolean Rule Evaluation Engine

    Construct an object-oriented expression tree for logical and comparison operations that evaluates safely against context dictionaries with short-circuiting.

    Data Structure Designobject-oriented-designtreecomposite-patternevaluation-engine
  • Linked ListsMediumModel answer
    Unlink From the Tail and Prune a Tree by Leaf Swap

    Two pointer-manipulation tasks: remove the k-th node from the tail of a singly linked list, and delete a value from a general binary tree by overwriting it with the deepest-rightmost node's value.

    Linked Listslinked-listtwo-pointersbinary-treebfs
  • Arrays & HashingMediumModel answer
    Solving Multi-Task Online Assessment Challenges

    A guide to solving four standard assessment tasks: cumulative running totals, step-by-step array reduction, deterministic matrix block placement, and linear arithmetic series optimization.

    Arrays & Hashingarrayssimulationgridoptimization
  • Data Structure DesignMediumModel answer
    Build an In-Memory Store with Nested Transactions and Value Counts

    Design a string key-value store with transactional writes, fast rollback, and a count of keys holding a given value, with all transaction semantics spelled out.

    Data Structure Designhash-maptransactionsundo-logdesign
  • Data Structure DesignMediumModel answer
    In-Memory Calendar Service and Interval Queries

    Design and implement an in-memory calendar event service with full CRUD operations, validation rules, conflict detection, and unit testing strategy.

    Data Structure Designdesignintervalscrudvalidation
  • Data Structure DesignMediumModel answer
    Design a Weighted Sampling Generator with Dynamic Updates

    Implement a class for weighted sampling that supports O(1) sampling for static inputs and logarithmic updates for dynamic environments.

    Data Structure Designdesign-dsheaps-sortingmath-bits
  • Data Structure DesignMediumModel answer
    Cross-Venue Quote Book and Arbitrage Scanner

    Build an in-memory engine that keeps the latest valid top-of-book quote per venue, expires old ones, and reports the most profitable buy-low/sell-high pair across venues.

    Data Structure Designclass-designhash-mapmarket-dataedge-cases
  • Arrays & HashingMediumModel answer
    Simulate Grid Rover Fleet Collision Logic

    Simulate the concurrent step-by-step navigation of multiple automated grid rovers, handling collisions, static obstacles, and grid bounds.

    Arrays & Hashingarrayssimulationmatrixhash-table
  • Data Structure DesignMediumModel answer
    Thread-Safe Ledger Accounts with Transfer and Absorb Operations

    Design a concurrency-safe Account class supporting deposits, withdrawals, atomic transfers, and absorbing another account, while preventing overdrafts, deadlocks, and operations on closed accounts.

    Data Structure Designoopconcurrencylockingdeadlock
  • Math & Bit ManipulationEasyModel answer
    Axial Tilt and Doubling Money: Two Estimation Questions

    Explain the physical cause of hot summers and cold winters, then compute the balance of a $1,000 deposit that earns 100% interest compounded yearly for 20 years.

    Math & Bit Manipulationestimationcompound-interestexponential-growthmental-math
  • Data Structure DesignMediumModel answer
    Object-Oriented Design for a Multi-Floor Garage Allocator

    Design classes and an allocation API for a multi-floor garage that assigns the closest suitable bay to each vehicle, stays correct under concurrent requests, and handles a full garage.

    Data Structure Designobject-oriented-designconcurrencyheaplow-level-design
  • Data Structure DesignMediumModel answer
    Build a Three-Stage Signup Wizard with React Reducer State

    Design a React wizard with profile, address and review stages, covering validation, guarded navigation, disabled controls, a submit spinner and server error display, plus scaling and performance trade-offs.

    Data Structure DesignreactformsuseReducervalidation
  • Arrays & HashingMediumModel answer
    Simulate Cascade Board Game Outcome

    Simulate a custom board game involving stack placing and directed toppling moves to determine the game outcome.

    Arrays & Hashingarrayssimulationmatrix
  • Trees & GraphsMediumModel answer
    Collect Every Reachable Page on a Single Host

    Write a function that explores a website from one starting URL, following only links on the same hostname, and returns each distinct page once while coping with link cycles.

    Trees & Graphsgraph-traversalbfsurl-normalizationdeduplication
  • Data Structure DesignMediumModel answer
    Strong vs Weak Counts in shared_ptr and How weak_ptr Breaks Cycles

    Describe the two reference counts in a shared_ptr control block, how weak_ptr uses them, why lock() is needed, and how a weak back-edge fixes a leaking ownership cycle.

    Data Structure Designcppsmart-pointersshared_ptrweak_ptr
  • Greedy & IntervalsMediumModel answer
    Real-Time Courier-to-Delivery Matching Engine Design

    Design a scalable real-time engine that matches couriers to incoming delivery requests, defining the cost model, candidate pruning, matching method, complexity, and failure handling.

    Greedy & Intervalsmatchinggreedyspatial-indexreal-time
  • StringsMediumModel answer
    Three-Part Drill: Anagram Buckets, One-Swap Max, Sentiment Top-K

    A three-part coding set: bucket words by letter makeup, maximize a number with at most one digit swap, and rank hotels by keyword-based review sentiment.

    Stringshash-mapanagramsgreedytokenization