KatInterview

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

Interview Practice 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 511–540 of 2221 results

  • Arrays & HashingMediumAuto-graded
    Bucket Words by Letter Multiset Without Per-Word Sorting

    Cluster words that share identical letter counts into ordered buckets, using a hashable frequency key rather than sorting each word's letters, while preserving duplicates and order.

    Arrays & Hashinghash-mapstringsanagramsfrequency-count
  • Data Structure DesignMediumAuto-graded
    Run-of-K Grid Game Simulator for Many Players

    Simulate an N x N, M-player connect-K game with turn order, move validation, win detection from the last move, board snapshots and undo.

    Data Structure Designsimulationgriddesignundo
  • Trees & GraphsMediumAuto-graded
    Longest Chain of Accounts Reachable Through Follows

    Find the longest simple path from a start node in a directed graph with possible cycles, using backtracking DFS with a per-path visited set.

    Trees & Graphsgraphdfsrecursionbacktracking
  • Arrays & HashingEasyAuto-graded
    Monthly Hit Tracks: Overall and Per-Region Leaderboards

    Filter streaming events by duration and date window, count plays per track, and produce a global top 5 and per-country top 3 with deterministic tie-breaking.

    Arrays & Hashinghash-mapcountingsortinggrouping
  • StringsMediumAuto-graded
    Compressed Word Check Plus Bracket Matching

    Tests two linear scans in one function: validating a numeric-skip word abbreviation with two pointers, and checking nested bracket balance with a stack.

    Stringstwo-pointersstackstring-parsingvalidation
  • Arrays & HashingEasyAuto-graded
    Keep Only First Appearances in an Integer List

    Tests using a hash set alongside a list to filter repeated integers in one pass while preserving first-appearance order, in linear time.

    Arrays & Hashinghash-setarraysdeduplicationorder-preservation
  • Data Structure DesignMediumAuto-graded
    Roster Coverage and Rating Leaderboard Simulator

    Simulate a command log against a stateful tracker that merges per-agent time intervals and ranks agents by average rating with alphabetical tie-breaking.

    Data Structure Designdesignintervalshash-mapsorting
  • Arrays & HashingMediumAuto-graded
    Users With a Qualifying Login Session in an Unordered Event Log

    Pair sign-in and sign-out events per user from an unsorted log using chronological order and FIFO matching, and report users with a session within a time limit.

    Arrays & Hashinghash-mapsortingqueuesimulation
  • Trees & GraphsMediumAuto-graded
    Five-Task Toolkit: Graphs, Swaps, Digits, Cache, Trees

    Solve five small tasks in one call: count graph components, minimum swaps to sort, largest monotonic number, simulate an LRU cache, and compare two N-ary trees.

    Trees & Graphsgraph-traversalcycle-decompositiongreedy-digitslru-cache
  • Arrays & HashingMediumAuto-graded
    Seeded Two-Round K-Means with Spread-Out Starting Centers

    Simulate k-means++ seeding with a fixed RNG protocol, then run two assign/update rounds and report clusters, centroids and final squared error.

    Arrays & Hashingsimulationclusteringrandomized-samplingfloating-point
  • Stacks & QueuesMediumAuto-graded
    Resolve Field Paths in a Nested Message Schema

    Parse brace-delimited nested message definitions line by line, then check which dotted query paths name an actual field, tracking scope with a stack.

    Stacks & Queuesparsingstackhash-setstrings
  • Trees & GraphsMediumAuto-graded
    Tally Separate Clusters of Ones in a Binary Matrix

    Count 4-directionally connected clusters of 1s in a binary matrix using graph traversal, with care for visited tracking, empty inputs, and deep clusters.

    Trees & Graphsdfsgridconnected-componentsmatrix
  • Data Structure DesignMediumAuto-graded
    Batch-Driven Slash-Path Registry with Leaf-Only Deletion

    Simulate a tree-shaped registry addressed by slash-separated paths, processing a batch of create, set, get and remove commands and returning one result per command.

    Data Structure Designtriehash-mapdesignstring-parsing
  • Trees & GraphsHardAuto-graded
    Shortest Looping Command Script for a Fuel-Limited Rover

    Brute-force enumerate looping command scripts of length 1 to 10 and simulate each on a grid with fuel, walls and refuel pads, using state-repeat detection to stop loops.

    Trees & Graphssimulationbrute-forcegridcycle-detection
  • Dynamic ProgrammingHardAuto-graded
    Daily Vendor Booking with No Immediate Repeats

    Choose one vendor per day to minimize total price with no vendor on consecutive days, returning the plan with a fixed tie-break; tests DP, backtracking, and best/second-best.

    Dynamic Programmingdynamic-programmingpath-reconstructionoptimizationarrays
  • Arrays & HashingMediumAuto-graded
    Longest Run of Non-Repeating Numbers in an Array

    Find the length of the longest contiguous stretch of an integer array in which no value appears twice, using a sliding window with a last-seen index map.

    Arrays & Hashingsliding-windowhash-maptwo-pointerssubarray
  • Math & Bit ManipulationMediumAuto-graded
    Working Days Between Two Dates with a Closure List

    Count Monday-to-Friday days in an inclusive date range, skipping listed closure dates, using week arithmetic instead of day-by-day iteration.

    Math & Bit Manipulationdatescalendararithmeticsets
  • Heaps, Sorting & SearchEasyAuto-graded
    Minimum Postponed Debits to Avoid Negative Balance

    Find the minimum number of negative transactions to postpone so that the running account balance remains non-negative throughout processing.

    Heaps, Sorting & Searchheaps-sortinggreedy-intervalsarrays
  • Math & Bit ManipulationMediumAuto-graded
    Smallest Primes Prefix: Build the First n Primes

    Generate the first n primes in ascending order, which tests sieve design with an upper bound derived from a count, plus handling of non-positive n.

    Math & Bit Manipulationprimessievenumber-theorymath
  • Greedy & IntervalsEasyAuto-graded
    Filter Financial Logs by Active Premium Periods

    Filter a chronological sequence of transaction records based on whether they fall within active premium membership intervals.

    Greedy & Intervalsintervalsdata-filteringhash-table
  • Data Structure DesignMediumAuto-graded
    Append-Only Editor with Undo and Redo Replay

    Simulate a tail-only text buffer with undo and redo histories, recording only edits that change the text and clearing redo on every new edit.

    Data Structure Designdesignstacksimulationundo-redo
  • SQL & DataMediumAuto-graded
    Rebuild a Seven-Day Account Exposure Report from Trade Feeds

    Deduplicate late-arriving trade versions, filter by status, window and KYC, then aggregate per account and day into exposure, utilization and breach figures.

    SQL & Datadata-manipulationdeduplicationaggregationjoins
  • Arrays & HashingMediumAuto-graded
    Match Cells by Four-Way Gap to Nearest Blocker

    Compute, for every empty cell, the gap to the nearest blocker in each of four directions using linear sweeps, then return the cells whose four gaps equal a given target.

    Arrays & Hashinggridmatrixprefix-sweepsimulation
  • Arrays & HashingMediumAuto-graded
    Assign Persistent Table Column Identifiers

    Process sequential database schema snapshots to assign permanent, case-insensitive unique column aliases with automatic collision resolution.

    Arrays & Hashingarraysstringsdesign-ds
  • Trees & GraphsMediumAuto-graded
    Rebuild a Nested Menu Tree from Indented Text

    Parse an indentation-based, pipe-delimited menu into a nested tree of dictionaries, testing stack-based hierarchy reconstruction and careful field parsing.

    Trees & Graphstree-constructionstackparsingstrings
  • Arrays & HashingEasyAuto-graded
    Keep First Record Per Login ID in Linear Time

    Filter a list of record dictionaries so only the first record for each identifier remains, preserving order and doing it in a single linear pass with a hash set.

    Arrays & Hashinghash-setdeduplicationarraysorder-preservation
  • Greedy & IntervalsEasyAuto-graded
    Partition Array Under Segment Capacity Limit

    Determine the minimum number of contiguous segments needed to split an array such that no segment's total sum exceeds a specified capacity limit.

    Greedy & Intervalsarraysgreedy
  • SQL & DataEasyAuto-graded
    Find Nth Highest Distinct Salary

    Find the Nth highest unique value in a list of integers, returning None if N is out of valid bounds.

    SQL & Dataarrayssortingsql
  • Arrays & HashingMediumAuto-graded
    Find Unique Integer Triplets Summing to Target

    Finds all unique value triplets in an integer array that sum to a specified target using sorting, two-pointer scanning, and pruning.

    Arrays & Hashingarraystwo-pointerssortingdeduplication
  • Heaps, Sorting & SearchMediumAuto-graded
    Longest Equal Cable Segment From Spools

    Find the largest integer segment length such that cutting every spool into equal segments yields at least k segments, using binary search on a monotonic feasibility check.

    Heaps, Sorting & Searchbinary-searchbinary-search-on-answermonotonic-predicatearrays