KatInterview

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

Coding Interview Problems

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

6010
Problems
2227
Auto-graded
15
Topics
275
Added today

Showing 2071–2100 of 2781 results

  • 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
  • Arrays & HashingMediumAuto-graded
    Longest All-Ones Window After Limited Bit Flips

    Tests the ability to reframe a flip problem as a sliding-window search and reason about amortized complexity.

    Arrays & Hashingsliding-windowtwo-pointersarrays
  • Data Structure DesignMediumModel answer
    Build a nested namespace tree from dotted model parameter names

    Convert a flat list of dotted parameter keys like layer indices into a grouped nested dictionary, collecting nonconforming, duplicate, and structurally conflicting keys separately.

    Data Structure Designstringshashingtrieedge-cases
  • Greedy & IntervalsMediumAuto-graded
    Consolidate Overlapping Ranges

    Tests interval merging with sorting, overlapping logic, and immutability constraints

    Greedy & Intervalsintervalssortinggreedyarrays
  • Data Structure DesignMediumAuto-graded
    Worker Pay Rate Ledger with Interval Cost Queries

    Tests piecewise-constant function integration, lazy evaluation, and interval clipping inside a simulated in-memory billing system.

    Data Structure Designdesignintervalssimulation
  • Trees & GraphsHardAuto-graded
    Compute Division Chains from Given Ratios

    Tests graph modeling of multiplicative relationships and pathfinding to derive transitive ratios between variables.

    Trees & Graphsgraphbfsunion-find
  • Math & Bit ManipulationMediumModel answer
    Compute Sum of Divisible Integers Using Inclusion-Exclusion

    Find the total of all positive integers below n divisible by 3, 5, or 7 in constant time using arithmetic series and inclusion-exclusion.

    Math & Bit Manipulationinclusion-exclusionarithmetic-seriesnumber-theory
  • Dynamic ProgrammingMediumModel answer
    0/1 Knapsack: Space-Efficient DP with Item Recovery

    Implement a weight-capacity optimizer returning max value and an exact item set, using O(W) space DP, then extend to unbounded and bounded variants.

    Dynamic Programmingdynamic-programmingknapsackreconstructionoptimization
  • Trees & GraphsMediumAuto-graded
    Match Documents Against Filter Expressions

    Build a recursive evaluator for filter expressions with logical operators and field comparisons, testing tree traversal and nested field lookup.

    Trees & Graphsrecursiontreesdictionaries
  • Data Structure DesignMediumAuto-graded
    Parcel Locker Manager with History Tracking

    Build a locker allocation system that assigns the smallest free locker, validates pickups, and remembers the last package stored in each locker.

    Data Structure Designheapsimulationdata-structure-design
  • Data Structure DesignHardAuto-graded
    Timestamped Press-and-Release Event Classifier

    Tests per-button state tracking and timing logic over an ordered event stream to classify completed press-release pairs by hold duration.

    Data Structure Designhash-mapevent-streamstate-machine
  • Data Structure DesignMediumModel answer
    Build a Thread-Safe Future: Chaining and Parallel Fan-In

    Implement a generic async future primitive supporting blocking get, callback chaining, and a barrier that resolves when all parallel futures complete.

    Data Structure Designconcurrencyfuturesthreadingcallbacks
  • Trees & GraphsMediumModel answer
    Search and Shortest-Path Algorithms

    Implement binary search on a monotone predicate, BFS for state-space and grid shortest paths, and random board generation with adjacency counting.

    Trees & Graphsbinary-searchbfsshortest-pathgraph-traversal
  • Trees & GraphsMediumAuto-graded
    Verify BST Property on a Level-Order Encoded Tree

    Test whether a breadth-first list representation of a binary tree satisfies strict BST ordering without allowing duplicate values.

    Trees & Graphsbinary-treebstvalidation
  • Data Structure DesignMediumAuto-graded
    Simulate a Frequency-Based Eviction Cache

    Tests ability to simulate a sequence of get/put/delete operations on an LFU-like cache that evicts the least-frequently-used key on overflow, with tie-breaking by insertion order.

    Data Structure Designdata structuressimulationcache
  • Greedy & IntervalsMediumAuto-graded
    Find the Highest-Scoring Boundary Pair in an Array

    Tests whether a candidate can exploit a telescoping sum identity to reduce an interval scoring problem to a fast two-endpoint selection with careful tie-breaking.

    Greedy & Intervalsarraysgreedytwo-pointers
  • Stacks & QueuesMediumAuto-graded
    Bracket Matching, Interval Union, and Expression Parsing

    Tests stack-based bracket validation, interval merging with endpoint semantics, and arithmetic evaluation with unary operators.

    Stacks & Queuesstacksintervalsparsingexpression-evaluation
  • Arrays & HashingMediumAuto-graded
    R² Bounds When Two Predictors Are Combined in OLS

    Tests whether a candidate can derive the valid range of R² for a joint OLS model given the individual R² values of two single-predictor models.

    Arrays & HashingstatisticsregressionOLS
  • Arrays & HashingHardAuto-graded
    Cost-Aware Fraud Model Comparison

    Compares classification models using business costs, derives optimal decision thresholds, and identifies the most economical model.

    Arrays & Hashingclassificationcost-sensitive-learningconfusion-matrixmodel-evaluation
  • Data Structure DesignMediumModel answer
    Multi-Level Parking Facility: Class Structure and Operations

    Model a parking facility with levels and sized spots, supporting vehicle entry/exit, spot allocation by compatibility, and availability queries.

    Data Structure Designobject-oriented-designSOLID-principlesdesign-patternsclass-modeling
  • Dynamic ProgrammingMediumModel answer
    Flappy Bird Auto-Pilot with Lookahead Planning

    Design a physics-based agent that decides when to jump by projecting future trajectories and checking collision-free paths through upcoming obstacles.

    Dynamic Programminggame-physicssimulationtrajectory-planning
  • Dynamic ProgrammingMediumAuto-graded
    Maximum Score With No Two Adjacent Drops

    Tests whether a candidate can model a pick/skip DP with a "no two consecutive skips" constraint using O(1) space and O(n) time.

    Dynamic Programmingdynamic-programmingarraysgreedy
  • Arrays & HashingMediumAuto-graded
    Pair Indices with Given Sum

    Tests hash table usage and algorithm optimization to locate two array positions that sum to a target value.

    Arrays & Hashinghash-maptwo-pointersoptimization
  • StringsMediumAuto-graded
    Check Password Compliance and Report Violations

    Tests string validation logic, character classification, case-insensitive pattern matching, and consecutive character counting.

    Stringsvalidationstring-processingpattern-matching
  • Heaps, Sorting & SearchMediumAuto-graded
    Top-K Cutoff: Find the K-th Highest Value

    Tests order-statistics intuition by asking candidates to extract the k-th largest element from an unsorted array without a full sort.

    Heaps, Sorting & Searchheapsortingorder-statistics
  • Heaps, Sorting & SearchMediumAuto-graded
    Find Target Index in Sorted Array

    Tests ability to implement iterative binary search with correct loop invariants, boundary handling, and termination conditions.

    Heaps, Sorting & Searchbinary-searcharraysiterativealgorithm-implementation
  • Trees & GraphsHardAuto-graded
    Minimum Moves Across an Obstacle Grid

    Tests BFS-based shortest-path reasoning on an unweighted 2D grid with blocked cells and 4-directional movement.

    Trees & Graphsbfsgraph traversalgridshortest path