KatInterview

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

Coding Interview Problems

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

6013
Problems
2228
Auto-graded
15
Topics
276
Added today

Showing 2041–2070 of 2781 results

  • Data Structure DesignMediumModel answer
    Design a Lazy Iterator Pipeline with Range and Combinators

    Build a pull-based iterator for ranges with configurable steps and endpoints, plus composable transformations like map, filter, zip, take, drop, and chain.

    Data Structure Designiteratorslazy-evaluationfunctional-programming
  • Greedy & IntervalsMediumAuto-graded
    Maximum Non-Overlapping Meetings in a Workday

    Tests greedy interval scheduling and string parsing: convert "Name: HH:MM-HH:MM" strings into time intervals, then find the largest set of compatible meetings.

    Greedy & Intervalsgreedyintervalsstrings
  • Heaps, Sorting & SearchMediumAuto-graded
    Minimum Relay Power for Full Network Coverage

    Tests binary search on the answer combined with a greedy coverage check to find the minimum broadcast power so every city is reachable from a central hub.

    Heaps, Sorting & Searchbinary searchgreedysorting
  • Data Structure DesignHardModel answer
    Build a Concurrent Multi-Constraint Rate Limiter

    Design a thread-safe class that enforces several independent rate limits simultaneously, with atomic all-or-nothing permit acquisition and rollback on failure.

    Data Structure Designconcurrencyrate-limitingsliding-windowatomicity
  • Data Structure DesignMediumModel answer
    Async URL Batch Fetcher with Concurrency Limits

    Build an async function that fetches a list of URLs with bounded parallelism, deduplicates identical URLs, preserves input order, and isolates per-URL errors.

    Data Structure Designasyncconcurrencypythondeduplication
  • Stacks & QueuesMediumAuto-graded
    Skyline Visible Buildings Count

    Tests ability to use a monotonic stack to count, for each building, how many previous buildings are visible looking back from it along a city skyline.

    Stacks & Queuesmonotonic stackarrayssimulation
  • StringsMediumAuto-graded
    Build a Token Merger with Threshold-Based Pair Consolidation

    Tests implementation of a stateful tokenizer that learns merge operations by iteratively combining frequent adjacent pairs, then applies those rules to encode and decode text.

    Stringstokenizationgreedystate-management
  • Math & Bit ManipulationMediumModel answer
    Most Negative 8-bit Value with Exactly Three Set Bits

    Find the smallest two's-complement signed 8-bit integer whose binary representation contains exactly three 1 bits.

    Math & Bit Manipulationbit-manipulationtwo's-complementsigned-integers
  • Arrays & HashingMediumAuto-graded
    Best Subarray Sum in a Tiled Sequence

    Tests whether a candidate can extend Kadane's algorithm to a sequence formed by repeating an array k times, handling boundary crossings and all-negative inputs.

    Arrays & Hashingkadanesubarraygreedy
  • Trees & GraphsMediumAuto-graded
    Virus Spread on a Grid

    Tests multi-source BFS on a 2D grid to find the minimum number of rounds for an infection to reach every susceptible cell, or detect if it cannot.

    Trees & Graphsbfsmatrixmulti-source
  • Data Structure DesignMediumModel answer
    Alphabet-Coverage Web Crawler with Rate Limiting

    Build a crawler that prioritizes unvisited first-letters across a link graph while respecting a configurable requests-per-second ceiling.

    Data Structure Designcrawlingrate-limitingpriority-queuededuplication
  • Data Structure DesignMediumModel answer
    Four Algorithm Problems: Graphs, Search, Simulation, and Design

    Solve four independent problems covering Eulerian path reconstruction, timestamped key-value lookup, ray reflection simulation, and a high-throughput score tracker.

    Data Structure Designgraphsbinary-searchsimulationdata-structure-design
  • Arrays & HashingMediumAuto-graded
    Best Sum of Extremes in a Contiguous Subarray

    Tests whether a candidate can reduce an O(n²) subarray search to a single linear scan by proving that adjacent pairs always dominate longer windows.

    Arrays & Hashingarraysgreedysliding-window
  • Data Structure DesignMediumAuto-graded
    Group Expense Balancer: Greedy vs Optimal Settlement

    Tests ability to implement both a greedy two-pointer debt-clearing algorithm and an exact minimum-transaction settlement using memoized recursion.

    Data Structure Designgreedymemoizationsimulation
  • StringsMediumAuto-graded
    Score Tasks From Event Log Strings

    Parse "id:command" log lines, accumulate weighted scores per task with a hash map, and keep only tasks that completed.

    Stringsstringshash-mapsimulationparsing
  • Math & Bit ManipulationMediumAuto-graded
    Balance Integer Values to Minimize Spread

    Tests understanding of integer division, remainder distribution, and handling negative numbers in a fairness optimization problem.

    Math & Bit Manipulationmathgreedydivisionedge-cases
  • StringsMediumAuto-graded
    Count Sliding Windows Matching a Step-Direction Sequence

    Tests whether a candidate can reduce pairwise comparisons to a sign sequence and count all overlapping pattern matches in linear time using KMP.

    Stringsstring-matchingkmparrayssliding-window
  • StringsEasyAuto-graded
    Grid Walker: Did the Drone Return to Base?

    Tests whether a candidate can simulate 2D movement on a grid and determine if a sequence of directional steps nets zero displacement.

    Stringsstringssimulationmath-bits
  • Data Structure DesignHardModel answer
    Build a Reference-Counted Pointer from Scratch in C++

    Implement a class template SharedPtr<T> that manages heap object lifetime through reference counting, supporting copy, move, reset, and safe self-assignment.

    Data Structure DesignC++RAIImemory managementtemplates
  • Trees & GraphsMediumAuto-graded
    Earliest-Arrival Reachability on Timed Transit Routes

    Tests whether a candidate can model time-respecting graph search over indexed transit routes to determine if a destination is reachable from a starting stop.

    Trees & Graphsgraph searchBFSgreedyshortest path
  • Arrays & HashingMediumAuto-graded
    Three Independent Array Challenges

    Tests greedy gain selection, modular triplet counting, and DP-based longest flexible non-decreasing subarray in one combined function.

    Arrays & Hashinggreedydynamic-programmingcombinatorics
  • Dynamic ProgrammingMediumAuto-graded
    Best Revenue from Selling Rod Segments

    Tests dynamic programming by finding the optimal way to partition a rod into segments to maximize total selling price.

    Dynamic Programmingdynamic-programmingoptimizationunbounded-knapsack
  • Data Structure DesignMediumModel answer
    Expiring Credit Wallet: Drain Soonest-Expiring First, Halt on Overdraft

    Design an in-memory credit ledger that consumes the earliest-expiring balance first and permanently returns None after any overdraft.

    Data Structure Designheapgreedysimulationexpiry
  • Greedy & IntervalsEasyAuto-graded
    Consolidate Overlapping Time Ranges by Group

    Tests interval merging within distinct groups, requiring grouping logic, sorting, and adjacent-interval handling.

    Greedy & Intervalsintervalsgroupingsorting
  • Trees & GraphsMediumAuto-graded
    Cheapest Type Transformation Path

    Tests shortest-path reasoning on a weighted directed graph, including source-caching strategy, zero-cost edges, unreachable nodes, and same-source queries.

    Trees & Graphsgraphsshortest-pathdijkstra
  • Trees & GraphsMediumAuto-graded
    Optimal Empty Cell with Minimum Path Distance Sum

    Tests multi-source BFS to find an empty cell minimizing total shortest-path distance to all targets on a grid with obstacles.

    Trees & Graphsbreadth-first-searchgraphsgrid-traversal
  • Data Structure DesignMediumAuto-graded
    Snapshot Reads from a Multi-Version Key-Value Log

    Tests whether you can design a versioned key-value store that answers "what was the value at time T?" in sub-linear time using binary search on per-key version histories.

    Data Structure Designbinary-searchhash-tabledesign
  • Trees & GraphsMediumAuto-graded
    Build Travel Route from Airline Tickets

    Tests directed graph traversal, Eulerian path construction, and lexicographical ordering with Hierholzer's algorithm.

    Trees & Graphsgraphsdfseulerian-pathbacktracking
  • Data Structure DesignMediumModel answer
    Build a Reference-Counted Smart Pointer in C++

    Design and implement a shared ownership pointer with automatic memory management using reference counting and RAII principles.

    Data Structure Designc++memory-managementraiimove-semantics
  • Greedy & IntervalsMediumAuto-graded
    Greedy Starting Point for a Circular Fuel Route

    Tests whether a candidate can apply a greedy one-pass argument to find the unique valid departure station in a circular gas-station problem.

    Greedy & Intervalsgreedyarraystwo-pointers