KatInterview

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

Coding Interview Problems

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

6000
Problems
2221
Auto-graded
15
Topics
273
Added today

Showing 1651–1680 of 2121 results

  • Math & Bit ManipulationMediumAuto-graded
    Observer Simulation and Manual Integer Conversion

    Tests event-driven simulation optimization and precise numeric string formatting including signed 32-bit boundary handling.

    Math & Bit Manipulationsimulationmathstring-manipulation
  • Arrays & HashingMediumAuto-graded
    Group and Rank Users by Average Value

    Tests efficient grouping and aggregation over dictionaries, plus multi-key sorting to produce ordered output.

    Arrays & Hashingaggregationdictionariessorting
  • Arrays & HashingEasyAuto-graded
    Filter and Sort Items by Embedding Similarity Score

    Tests vector scoring with dot products, stable sorting with tie-breaking, and set-based filtering of excluded indices.

    Arrays & Hashingarrayssortingfiltering
  • Arrays & HashingMediumAuto-graded
    Suffix Maximum Frequency Count

    Computes how many times the largest element appears in each suffix of an array using a single backward scan.

    Arrays & Hashingarrayssuffix-queriessingle-pass
  • Trees & GraphsHardAuto-graded
    Reduce Worst-Case Coverage Gap with One New Relay Node

    Tests binary search on answer combined with multi-source BFS and 2D prefix sums to optimally place one relay node and minimize the maximum Chebyshev coverage distance.

    Trees & Graphsbinary-searchbfsmatrixprefix-sums
  • Linked ListsMediumAuto-graded
    Interleave Two Linked Lists by Position Parity

    Tests pointer manipulation and node reordering by splitting a singly linked list (given as an array) into odd- and even-indexed sublists and merging them in a specific interleaved pattern.

    Linked Listslinked listspointer manipulationreorderingarray simulation
  • Data Structure DesignMediumAuto-graded
    Simulate a Nested Tic-Tac-Toe Game with Board-Routing Rules

    Tests state management for a two-layer game board with recursive win detection and dynamic move constraints based on previous plays.

    Data Structure Designsimulationgame-theorystate-machine
  • Data Structure DesignMediumAuto-graded
    Duplicate Linked List and Simulate LRU Cache Operations

    Tests linked list deep copying with arbitrary pointers and implementing an LRU cache with O(1) operations using hash maps and doubly-linked lists.

    Data Structure Designlinked-listshash-mapdesignpointers
  • Arrays & HashingEasyAuto-graded
    Rank Nearest Neighbors by Mean Squared Error

    Tests k-nearest neighbors search with distance computation, NULL handling, and top-k selection with tie-breaking.

    Arrays & Hashingsimilaritydistance-metricsrankingdata-processing
  • Data Structure DesignEasyAuto-graded
    Simulate a Bounded LRU Cache with Get/Put Operations

    Tests the ability to simulate a fixed-capacity LRU cache by processing a sequence of get/put operations and collecting all get results in order.

    Data Structure Designdata structurescachesimulation
  • Trees & GraphsMediumAuto-graded
    Axis-Aligned Bounding Boxes of Grid Regions

    Tests BFS/DFS connected-components traversal on a 2D grid to locate distinct filled regions and compute the tightest enclosing rectangle for each.

    Trees & Graphsbfsdfsconnected-componentsgrid
  • Trees & GraphsMediumAuto-graded
    Shortest Path Through a Grid With Keys and One-Way Portals

    Tests BFS/Dijkstra on an augmented state space where position must be combined with a key-collection bitmask, and directional arrow tiles enforce constrained traversal.

    Trees & Graphsbfsdijkstrabitmaskgrid
  • Heaps, Sorting & SearchHardAuto-graded
    Select Best Available Venues by Ranking Criteria

    Tests filtering, multi-level sorting with custom tie-breaking rules, and efficient top-K selection from structured data.

    Heaps, Sorting & Searchsortingfilteringheappriority-queue
  • Data Structure DesignMediumAuto-graded
    Key-Value Store Operation Simulator

    Tests ability to use hash maps for constant-time operations and handle state transitions in a key-value store simulation.

    Data Structure Designhash-mapsimulationdata-structures
  • Heaps, Sorting & SearchEasyAuto-graded
    Combine Multiple Sorted Lists into a Single Sorted Sequence

    Tests divide-and-conquer merging and two-pointer techniques to efficiently combine many pre-sorted lists.

    Heaps, Sorting & Searchdivide-and-conquertwo-pointersmerging
  • Greedy & IntervalsMediumAuto-graded
    Single Buy-Sell Stock Gain

    Tests finding the maximum profit from one purchase and one sale in a price sequence using a single-pass greedy approach.

    Greedy & Intervalsgreedyarrayssliding-window
  • Data Structure DesignMediumAuto-graded
    Historical Key-Value Store with Time-Based Retrieval

    Tests your ability to build a versioned data store supporting efficient historical lookups through binary search on sorted timestamps.

    Data Structure Designbinary-searchhash-mapdata-structures
  • Trees & GraphsMediumAuto-graded
    Lexicographically Smallest Schedule or Detect a Deadlock

    Tests Kahn's algorithm with a min-heap to produce the lexicographically smallest valid processing order across nodes in a directed dependency graph, or detect a cycle.

    Trees & Graphstopological-sortgraphsheap
  • Arrays & HashingMediumAuto-graded
    Zero-Sum Triplets in an Array

    Tests two-pointer technique on sorted arrays, duplicate avoidance, and quadratic complexity optimization for finding triplet combinations.

    Arrays & Hashingtwo-pointerssortingarray-traversal
  • Data Structure DesignHardAuto-graded
    Sliding-Window Event Counter with a Circular Bucket Buffer

    Design a fixed-memory event counter using a ring buffer of per-second buckets that tracks how many events fell inside a trailing 15-minute window.

    Data Structure Designring-buffersliding-windowdesignsimulation
  • Trees & GraphsMediumAuto-graded
    Spell Words Along Connected Paths in a Letter Grid

    Tests backtracking DFS with trie-based pruning to find all words from a large list that can be traced through edge-adjacent, non-repeating cells in a 2-D letter grid.

    Trees & Graphsbacktrackingtriedfs
  • Arrays & HashingMediumAuto-graded
    Sliding Window Average over an Integer Sequence

    Tests whether a candidate can compute consecutive fixed-width window averages in O(n) time by maintaining a running sum instead of recomputing each window from scratch.

    Arrays & Hashingsliding-windowarraystwo-pointers
  • StringsMediumAuto-graded
    Text Substitution with Whole-Word Match and Longest-Prefix Priority

    Apply a phrase-to-replacement map on the original text in one pass, respecting whole-word boundaries and preferring longer matches.

    Stringstriegreedystring-matching
  • Stacks & QueuesMediumAuto-graded
    Lexicographically Smallest Digit Sequence from Rise/Fall Pattern

    Tests greedy thinking and stack-based reversal to build the smallest digit string satisfying a sequence of increase and decrease constraints.

    Stacks & Queuesgreedystackstrings
  • StringsEasyAuto-graded
    Scale Serving Sizes in a Shopping List

    Tests careful string parsing: multiply only the leading numeric token in each line while leaving the rest of the text exactly as-is.

    Stringsstringsparsinglist manipulation
  • StringsHardAuto-graded
    Detect a Contiguous Block Inside an Integer Sequence

    Tests the ability to determine whether one integer array appears as an unbroken, in-order block inside a larger array using linear-time pattern matching.

    StringsKMPpattern matchingarrayssubsequence
  • Arrays & HashingMediumAuto-graded
    Collect Characters by Walking a Grid

    Tests grid traversal with directional commands, run-length encoding, and boundary/obstacle validation.

    Arrays & Hashingmatrixsimulationstring-building
  • Trees & GraphsMediumAuto-graded
    Find Valid Completion Sequence for Dependent Tasks

    Tests understanding of topological sorting, dependency graph modeling, and cycle detection in directed acyclic graphs.

    Trees & Graphstopological-sortgraphsbfscycle-detection
  • Greedy & IntervalsMediumAuto-graded
    Maximize Pay by Filling Gaps in a Shift Schedule

    Tests greedy reasoning and run-based reformulation to optimally spend a limited number of schedule changes for maximum earnings with streak bonuses.

    Greedy & Intervalsgreedydynamic-programmingarrays
  • Data Structure DesignMediumAuto-graded
    Cart History: Undo and Redo Item Changes

    Design a cart with reversible add/remove operations, tracking change history with undo/redo stacks.

    Data Structure Designdata-structuresstackstate-management