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 1471–1500 of 2127 results

  • Arrays & HashingMediumAuto-graded
    Valid Subsets Bounded by Their Spread

    Count non-empty index-distinct subsets where the smallest plus largest value stays within a limit, using sorting, two pointers, and modular arithmetic.

    Arrays & Hashingtwo-pointerssortingcombinatorics
  • Data Structure DesignHardAuto-graded
    Build a Record Filter with Nested Query Conditions

    Evaluate structured filter expressions with comparison, membership, and logical operators over in-memory records

    Data Structure Designrecursiondata-structuresquery-evaluation
  • Dynamic ProgrammingHardAuto-graded
    Maximize Hourly Output Revenue for a Three-Stage Assembly Line

    Tests budgeted 0/1 selection with a bottleneck objective, requiring Pareto-frontier pruning over a four-dimensional knapsack state space.

    Dynamic Programmingknapsackpareto-frontierbottleneckcombinatorial-optimization
  • Data Structure DesignEasyAuto-graded
    Find Minimum Index Gap Between Word Pairs

    Tests the ability to preprocess data for efficient repeated lookups using hash maps and two-pointer merging of sorted lists.

    Data Structure Designhash-maptwo-pointerspreprocessing
  • StringsEasyAuto-graded
    Total Palindrome Substrings in a String

    Tests your ability to count every palindromic substring by expanding around centers or applying Manacher's linear-time algorithm.

    Stringsstringsdynamic-programmingtwo-pointers
  • StringsEasyAuto-graded
    First Longest Window of Distinct Characters

    Tests whether a candidate can apply the sliding window technique with a hash map to find the earliest, longest non-repeating character run in a string.

    Stringssliding-windowhash-maptwo-pointers
  • Heaps, Sorting & SearchMediumAuto-graded
    Top-K Labels by Frequency with Alphabetical Tie-Breaking

    Tests frequency counting and compound-key sorting to find the k most common strings, resolving ties by alphabetical order for both ranking and inclusion.

    Heaps, Sorting & Searchsortinghash-mapheap
  • Data Structure DesignMediumAuto-graded
    Deduplicate Repeated Log Messages with Time Window

    Filter a time-ordered stream of log messages to show each distinct message only once per 10-second window

    Data Structure Designhash-mapstreamingrate-limiting
  • Trees & GraphsMediumAuto-graded
    Shortest Route Through a Blocked Matrix

    Find the minimum number of unit moves from the top-left to the bottom-right cell of a 0/1 matrix, or report that no route exists.

    Trees & Graphsbfsgridshortest-pathgraph-traversal
  • Data Structure DesignMediumAuto-graded
    Simulate an In-Memory Key-Value Store

    Tests ability to implement a command-driven key-value store with correct upsert, lookup, conditional update, delete, and membership semantics.

    Data Structure Designhash-tablesimulationdesign
  • Linked ListsHardAuto-graded
    Find Where Two Linked Lists Merge

    Tests pointer manipulation and list traversal to locate the merge point of two singly linked lists in linear time with constant space.

    Linked Liststwo-pointerslinked-listspointer-manipulation
  • Arrays & HashingMediumAuto-graded
    Next Ace Probability Given at Least One Ace Already Drawn

    Tests conditional probability over sampling without replacement, combining hypergeometric counting with Bayes' theorem to handle a "at least one" conditioning event.

    Arrays & Hashingconditional-probabilitycombinatoricshypergeometric
  • Arrays & HashingMediumAuto-graded
    Slot-Aware Feed Deduplication Across Ordered Sections

    Tests whether candidates can implement a two-phase, cross-section deduplication policy with per-section slot limits, within-section uniqueness, and optional exempt sections.

    Arrays & Hashinghashingsimulationgreedy
  • Linked ListsMediumAuto-graded
    Reorder Linked List by Zigzag Level Buckets

    Tests pointer-manipulation intuition by reordering a singly-linked list (given as an array) into a zigzag pattern based on partitioning nodes into fixed-size buckets.

    Linked Listslinked listsarray manipulationreordering
  • Math & Bit ManipulationMediumAuto-graded
    Optimal Ball Distribution for Maximum Joint Red Probability

    Tests ability to formulate and optimize a probability function over discrete allocations with boundary analysis.

    Math & Bit Manipulationprobabilityoptimizationmath
  • Heaps, Sorting & SearchEasyAuto-graded
    Minimum Consecutive Gap Frequency

    Sort an array, find the smallest difference between adjacent elements, and count how many consecutive pairs share that difference.

    Heaps, Sorting & Searcharrayssortingcounting
  • Trees & GraphsHardAuto-graded
    Minimum Time to Complete All Build Tasks with Dependencies

    Tests ability to apply topological ordering (Kahn's algorithm) to schedule parallel tasks with durations and prerequisite chains, computing the earliest completion time.

    Trees & Graphsgraphstopological sortdynamic programmingBFS
  • Arrays & HashingMediumAuto-graded
    Three Probability Puzzles

    Tests understanding of optimal stopping, geometric probability, and Poisson processes through three independent probability calculations.

    Arrays & Hashingprobabilityoptimal-stoppingpoisson-processgeometric-probability
  • Dynamic ProgrammingMediumAuto-graded
    Smallest Venue Set That Fits a Group

    Tests capacity-constrained subset selection with multi-level tie-breaking: fewest venues, then minimum total capacity, then lexicographically smallest ID list.

    Dynamic Programmingdynamic-programmingsubset-sumcombinatorics
  • StringsHardAuto-graded
    Minimum Prefix Extension to Form a Palindrome

    Tests whether you can use the KMP failure function to find the longest palindromic prefix of a string and prepend the minimum number of characters to make it a palindrome.

    Stringsstringskmppalindrome
  • Data Structure DesignMediumAuto-graded
    Maintain Contiguous Delivery Sequence and Detect Gaps

    Tests managing out-of-order arrivals with sets to track the longest complete prefix and identify missing elements in a sparse range.

    Data Structure Designsetstrackingstate-management
  • Data Structure DesignMediumAuto-graded
    Time-Travel Array with Historical Query Support

    Design a data structure that tracks an array's evolution through snapshots and answers queries about past states efficiently.

    Data Structure Designbinary-searchversioningdata-structures
  • StringsMediumAuto-graded
    Extract Stock Symbols from a Text Snippet

    Tests whole-word, case-insensitive multi-token matching with trie-based scanning and deduplication ordered by a reference list.

    Stringsstringshashingtrie
  • Arrays & HashingHardAuto-graded
    Peak Subarray Sum in a Run-Length-Encoded Sequence

    Tests whether a candidate can find the maximum sum of a fixed-length window over a run-length-encoded array too large to expand in memory.

    Arrays & Hashingsliding-windowprefix-sumsrun-length-encodingbinary-search
  • StringsMediumAuto-graded
    Widest Alphabetic Boundary Gap Across Tokens

    Tests string scanning, ASCII letter detection, and single-pass maximum tracking with tie handling across whitespace-delimited tokens.

    Stringsstringsscanningcase-normalizationties
  • Arrays & HashingEasyAuto-graded
    Verify Which Orders Have Received Payments

    Given two unsorted lists of records linked by a shared booking_id, return a boolean per order indicating whether at least one matching payment exists.

    Arrays & Hashinghash-setlookupaggregation
  • Trees & GraphsMediumAuto-graded
    Grid Land Regions: Total Count and Unique Footprints

    Tests grid flood-fill for connected-component counting and translation-invariant shape canonicalization to identify structurally distinct land regions.

    Trees & Graphsgraph traversalflood fillconnected componentshashing
  • Trees & GraphsMediumAuto-graded
    Minimum-Cost Flight Path with Departure Window

    Tests constrained graph search: find the cheapest multi-leg flight route where only the first leg must depart within a given date range, connections must respect time ordering, and cycles are forbidden.

    Trees & Graphsdijkstragraphsshortest-path
  • Trees & GraphsMediumAuto-graded
    Mutual Connections: Find Shared Friends from Follow Data

    Tests graph reciprocity reasoning and set intersection: given directed follow edges, identify all users who are mutual friends with both members of every user pair.

    Trees & Graphsgraphsset-intersectionsocial-network
  • Trees & GraphsEasyAuto-graded
    Shortcut by Adding Free Unit Edges

    Reason about degrees of freedom: since you may add arbitrary weight-1 edges, the optimal distance collapses to a constant.

    Trees & Graphsgraphsshortest-pathreasoningedge-cases