KatInterview

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

Coding Interview Problems

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

5981
Problems
2215
Auto-graded
15
Topics
272
Added today

Showing 241–270 of 650 results

  • Arrays & HashingMediumModel answer
    Paginated API Fetching and Data Merging

    Fetch paginated JSON payloads from two separate endpoints, defensively clean and transform records, and merge them on a common key preserving the original sequence.

    Arrays & Hashingpaginationhttp-requestshash-tabledata-cleaning
  • Data Structure DesignMediumModel answer
    Build a Weekly Schedule Grid

    Construct an interactive 7-day schedule grid with hour slots, allowing users to add titled events via a clean, state-driven dialog without duplicate data sources.

    Data Structure Designfrontendreactstate-managementui-components
  • Trees & GraphsMediumModel answer
    Analyze Referral Chains and Detect Graph Cycles

    Process referral relationships with at most one parent per user. Detect cycles, extract acyclic prefixes, and compute root ancestors and depths for all users in O(n) total time.

    Trees & Graphstrees-graphsdfscycle-detectiongraph-traversal
  • StringsMediumModel answer
    Validate Palindrome Rearrangements and Sum High-Precision Decimals

    Check if a string's characters can form a palindrome, and implement precise addition of non-negative decimal strings without using native floating-point types.

    Stringsstringsmath-bitshash-table
  • Heaps, Sorting & SearchMediumModel answer
    Find Frequent Elements in Large-Scale Data Streams

    Design scalable algorithms to extract the top K most frequent elements from a data stream under both memory-bounded exact and memory-constrained approximate regimes.

    Heaps, Sorting & Searchheaps-sortingdesign-dsarrays
  • StringsMediumModel answer
    Debugging and Hardening a Lightweight Template Engine

    Trace three root causes in a minimal template rendering engine—regex greediness, loop parsing, and path traversal—and present targeted fixes with regression tests.

    Stringsdebuggingparsingregexsecurity
  • Trees & GraphsMediumModel answer
    Validate-As-You-Go Calculator with Positive Integer Results

    Evaluate a split-based arithmetic expression, returning false the moment any literal or intermediate value is non-positive or non-integer.

    Trees & Graphsrecursionexpression-evaluationpost-orderparsing
  • Data Structure DesignMediumModel answer
    Build an In-Memory Database with Querying and Indexing

    Design and write code for an in-memory document store that supports dynamic schemas, predicate filtering, projection, ordering, and index optimization.

    Data Structure Designin-memory-dbindexingdata-structuresdata-structure-design
  • Data Structure DesignMediumModel answer
    Concurrency Safety, Deadlocks, and Array vs Linked List Tradeoffs

    Four short fundamentals questions: what makes code safe under concurrent use, what a deadlock is, how to handle deadlocks, and how contiguous arrays compare with pointer-based linked lists.

    Data Structure Designconcurrencythread-safetydeadlockarrays
  • Greedy & IntervalsHardModel answer
    Bird Physics Tick and Fee-Ratio Block Packing

    Two coding tasks: a one-tick bird movement function with inclusive bounds, and a greedy block builder that scores transactions together with their unconfirmed ancestors.

    Greedy & Intervalsgreedytopological-sortcycle-detectionsimulation
  • Dynamic ProgrammingMediumModel answer
    Left-to-Right Plus/Times Expression from a Subsequence

    Decide whether a subsequence of positive integers, joined by + and * and evaluated strictly left to right, can equal a target, and produce one valid expression.

    Dynamic Programmingdynamic-programmingbacktrackingpruningreverse-search
  • Data Structure DesignMediumModel answer
    Building a Slab Pool for Uniform Objects with Alignment Safety

    Design a pool allocator that carves equal-sized slots from slabs, hands them out via an intrusive free list in O(1), respects alignment, and packs 9-byte payloads sensibly.

    Data Structure Designmemory-allocatorslabfree-listalignment
  • Data Structure DesignMediumModel answer
    Dynamic Anagram Collection Tracker with Group Size Optimization

    Design a class to insert, remove, and query the largest group of anagram words in real time, exploring performance trade-offs for read and write loads.

    Data Structure Designdesign-dsstringsarrays
  • Arrays & HashingMediumModel answer
    Modern Java 8 Toolkit: Lambdas, Streams, Optional, java.time

    Explain the major Java 8 language and library additions, when each one fits, and the common pitfalls, using short code examples.

    Arrays & Hashingjavajava-8lambdasstreams
  • Dynamic ProgrammingHardModel answer
    Best Self-Matching Count After Removing Array Elements

    Delete any elements from an array so the most remaining values equal their new 1-based position. Reduce it to a longest-chain problem solved in O(n log n).

    Dynamic Programmingdynamic-programminglongest-increasing-subsequencebinary-searchsubsequence
  • Dynamic ProgrammingMediumModel answer
    Autonomous Drone Navigation in Dynamic Canyons

    Design a deterministic per-tick controller for a thruster-driven drone navigating procedurally generated obstacle canyons using lookahead simulation.

    Dynamic Programmingdynamic-programminglookahead-searchsimulationmemoization
  • Data Structure DesignHardModel answer
    Design a Time-Series Cloud Credit Ledger

    Design an in-memory cloud billing system supporting delayed cashback rebates, account consolidation, point-in-time historical balance queries, and spend leaderboards.

    Data Structure DesignData Structure DesignHeapUnion FindBinary Search
  • Data Structure DesignMediumModel answer
    Build a Data-Fetching React Hook and Wire Up a Dashboard UI

    Write a React hook that fetches and reshapes API data with loading, error and refetch support, then connect a modal, a collapsible list and action buttons to component state.

    Data Structure DesignreacthooksuseEffectasync
  • Trees & GraphsHardModel answer
    Tree to String and Back: A Lossless Binary Tree Codec

    Build a pair of functions that flatten a binary tree of integers into a string and restore the identical tree from that string, with a clear format and a correctness argument.

    Trees & Graphsbinary-treeserializationpreorderstack
  • Data Structure DesignMediumModel answer
    Design a Database Connection Pool

    Implement a resource-managing connection pool wrapper that enforces pool limits, reuses idle connections, and handles lease lifecycles safely.

    Data Structure Designdesign-dsobject-oriented-designresource-managementconcurrency
  • Math & Bit ManipulationHardModel answer
    Comprehensive Algorithmic Practice Set: Bitwise, Window, Monotonic Stack & Tree Operations

    A practice collection covering essential algorithms: bit manipulation, two pointers, monotonic stack, dynamic programming, binary search, tree path XORs, and graph re-rooting.

    Math & Bit Manipulationbit-manipulationmonotonic-stacktree-dpdynamic-programming
  • Data Structure DesignMediumModel answer
    Transit Fleet Simulator: Sampling, Seating Limits, and Fast-Lane Riders

    Build a bus network simulator: downsample riders by origin-destination pair, board and drop under a capacity cap, validate event logs, and give priority-pass riders precedence.

    Data Structure Designsimulationheapstratified-samplingevent-ordering
  • Trees & GraphsMediumModel answer
    Shared Ancestors: Binary Tree to Multi-Parent Graph

    Find the lowest common ancestor of two nodes in a binary tree, then generalize to a directed acyclic graph where several incomparable lowest common ancestors can exist.

    Trees & Graphslowest-common-ancestorbinary-treedagbfs
  • Data Structure DesignMediumModel answer
    Design and Implement Connect Four with Game Logic and State Management

    Build a complete two-player Connect Four game on a 6x7 grid, including drop mechanics, win/draw state evaluation, edge-case prevention, and modular state architecture.

    Data Structure DesignArraysGame DesignState ManagementData Structures
  • Data Structure DesignMediumModel answer
    Tuning a Multithreaded C++ Pipeline for Speed and Tail Latency

    Explain how you would profile and speed up an existing multithreaded C++ service whose thread pool and queue are given, covering memory, cache, contention, and verification.

    Data Structure Designcppperformanceconcurrencyprofiling
  • Greedy & IntervalsMediumModel answer
    Matrix 90-Degree Clockwise Rotation and Maximum Interval Coverage

    Rotate a square grid 90 degrees clockwise and identify regions of maximal overlapping intervals using a sweep-line algorithm.

    Greedy & Intervalsarraysgreedy-intervalsheaps-sorting
  • Data Structure DesignMediumModel answer
    Thread-Safe Recurring Task Engine

    Design and implement a concurrent background scheduler that manages recurring execution intervals, supports execution cancellation, and handles thread-safe termination.

    Data Structure Designconcurrencyheapsthreadsdesign
  • Math & Bit ManipulationHardModel answer
    Numbers with Double Sum-of-Squares Decompositions

    Count unique pairs of non-negative integers whose squares sum to a target value, identifying numbers with exactly two representations up to a limit N.

    Math & Bit Manipulationmath-bitsarraysmath
  • Heaps, Sorting & SearchMediumModel answer
    Minimize Black-Box Unimodal Function Without Derivatives

    Find the minimum of a convex/unimodal function over continuous and discrete intervals using zero-order optimization.

    Heaps, Sorting & Searchbinary searchoptimizationunimodalgolden section
  • 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