KatInterview

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

Interview Practice Problems

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

6005
Problems
2225
Auto-graded
15
Topics
273
Added today

Showing 1591–1620 of 2225 results

  • StringsMediumAuto-graded
    Reconcile Payments with Invoices Using Memo and Amount

    Tests multi-pattern substring search, hash-based indexing, and greedy reconciliation with priority-based tie-breaking across two matching strategies.

    Stringsstring-matchinghash-mapgreedyaho-corasick
  • Math & Bit ManipulationHardAuto-graded
    Compute Complexity Bounds for Dense Matrix Operations

    Tests asymptotic analysis skills by deriving time and space complexity for dense matrix multiplication with multiple dimensions.

    Math & Bit Manipulationcomplexity-analysislinear-algebrabig-o
  • Trees & GraphsMediumAuto-graded
    Fewest Cells Through a Diagonal-Move Grid

    Find the length of the shortest 8-directional clean-cell path across a square 0/1 grid using BFS.

    Trees & Graphsbfsgridshortest-path
  • Data Structure DesignMediumAuto-graded
    Shared Token Bucket with Optimistic Concurrency

    Tests implementation of a token bucket rate limiter over a versioned key-value store, including lazy replenishment, clock skew tolerance, and CAS-based retry logic.

    Data Structure Designdesignconcurrencysimulation
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • SQL & DataMediumAuto-graded
    Distinct Content Categories per Reader

    Tests two-level aggregation: counting distinct content categories per reader on a target date, then bucketing those counts into a frequency histogram across all dates.

    SQL & Datagroupingaggregationhistogramhashing
  • 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
  • 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
  • Arrays & HashingMediumAuto-graded
    Largest Manhattan Distance of Aligned Subsequences

    Tests identifying that all-nonnegative distance terms let you reduce the search to complete diagonal overlaps, requiring quadratic iteration and overflow awareness.

    Arrays & Hashingarraystwo-pointersmathoptimization
  • Trees & GraphsMediumAuto-graded
    Flat Error Collection from a Recursive Schema Validator

    Tests ability to traverse a nested schema definition, flatten heterogeneous check results, and enforce a consistent empty-list contract across all node types.

    Trees & Graphsrecursionschema-validationflattening
  • Greedy & IntervalsMediumAuto-graded
    Consolidate Overlapping Time Ranges

    Tests whether a candidate can sort and linearly sweep a list of ranges to produce the minimal set of non-overlapping intervals covering all input.

    Greedy & Intervalsintervalssortinggreedyarray
  • Trees & GraphsMediumAuto-graded
    Alternating Direction Level Order Tree Traversal

    Tests BFS traversal with directional output reversal per level without corrupting the queue structure.

    Trees & Graphsbfsbinary-treelevel-orderqueue