KatInterview

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

Interview Practice Problems

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

6035
Problems
2235
Auto-graded
15
Topics
274
Added today

Showing 1141–1170 of 2235 results

  • Data Structure DesignMediumAuto-graded
    Bidirectional Walk Over a CIDR Block's Addresses

    Simulate a two-way cursor over the IPv4 addresses of a CIDR block using integer arithmetic, with exact boundary and no-move-on-failure rules.

    Data Structure Designiteratorbit-manipulationcidrsimulation
  • Arrays & HashingMediumAuto-graded
    Card Authorization Report with Time-Activated Block Rules

    Sort card authorization events by time and apply permanent, time-activated block rules to label each as APPROVE or REJECT, testing stable sorting, two-stream merging and hashing.

    Arrays & Hashinghashingsortingsimulationtwo-pointers
  • Data Structure DesignMediumAuto-graded
    Count Lower Readings in a Trailing Time Window

    Simulate a sequence of record and query operations over a timestamped stream, counting readings in a trailing window that are strictly lower than the latest reading.

    Data Structure Designsliding-windowbinary-searchsimulationstreaming
  • Heaps, Sorting & SearchMediumAuto-graded
    Gini Split Search Plus One Regression Gradient Step

    Sweep sorted feature values to find the lowest weighted-Gini binary split, and apply one MSE gradient descent update for linear regression.

    Heaps, Sorting & Searchsortingprefix-sweepgini-impuritygradient-descent
  • Trees & GraphsMediumAuto-graded
    Largest Chain Reaction From a Single Detonation

    Model one-way blast reach as a directed graph and find the largest set reachable from any single starting node, using exact integer distance checks.

    Trees & Graphsgraphdfsreachabilitygeometry
  • Trees & GraphsMediumAuto-graded
    Find the Exit of a Keyed Forest Graph

    Run a breadth-first search over (location, keys held) states in a forest with locked doors to find the first exit reached, or None.

    Trees & Graphsbfsgraphstate-space-searchparsing
  • Greedy & IntervalsMediumAuto-graded
    Collapse Overlapping Time Ranges Into Disjoint Blocks

    Sort closed integer ranges and sweep once to combine any that overlap or touch, returning the minimal ordered list of disjoint ranges.

    Greedy & Intervalsintervalssortingsweepgreedy
  • Trees & GraphsMediumAuto-graded
    Column Grid from a Tree: Reach a Value by Walking Non-Zero Cells

    Project a heap-indexed binary tree onto a depth-by-column grid, then use BFS over non-zero cells to decide whether a cell holding the target is reachable from a given start.

    Trees & Graphsbinary-treebfsgridvertical-order
  • Stacks & QueuesMediumAuto-graded
    Unnest Deeply Nested Lists Without Recursion

    Flatten an arbitrarily nested Python list into a single list in left-to-right order, treating only lists as containers and handling very deep nesting safely.

    Stacks & Queuesstackiterationnested-listsdepth-first-search
  • Trees & GraphsMediumAuto-graded
    Eager Formula Sheet with Cycle-Safe Updates

    Simulate a mini spreadsheet where formulas are evaluated at write time, dependents update eagerly, and any write that would create a dependency cycle is rejected without changing state.

    Trees & Graphsdependency graphtopological sortcycle detectionsimulation
  • Trees & GraphsMediumAuto-graded
    Duplicate a Nested Structure With Cycles and Shared Parts

    Build an independent deep copy of a nested container structure, preserving shared references and cycles, using a memo table and an explicit stack.

    Trees & Graphsdeep-copygraph-traversalmemoizationiterative-dfs
  • Data Structure DesignMediumAuto-graded
    Spreadsheet Cells With Sum Formulas and Loop Detection

    Simulate a command list on a spreadsheet whose cells hold integers or two-reference sum formulas, evaluating lazily and reporting circular references.

    Data Structure Designgraphdfscycle-detectionsimulation
  • Heaps, Sorting & SearchHardAuto-graded
    Pick the Bottle Kit With the Least Leftover Volume

    Choose the bottle kit that serves every dose request with minimal total leftover space, using sorting, prefix sums and binary search to stay efficient on large inputs.

    Heaps, Sorting & Searchbinary-searchprefix-sumssortinggreedy
  • Math & Bit ManipulationMediumAuto-graded
    Matrix Product, Fast Power and Fibonacci Toolkit

    Combine matrix multiplication, square-and-multiply exponentiation and 2x2 matrix-power Fibonacci, with optional modular arithmetic, in one function.

    Math & Bit Manipulationmatrix-multiplicationfast-exponentiationfibonaccimodular-arithmetic
  • Data Structure DesignMediumAuto-graded
    Most Likely Follower Lookup via Operation Log

    Simulate a bigram next-word model from an operation log, returning the most frequent follower with lexicographic tie-breaking and an empty string when none exists.

    Data Structure Designhash-mapdesigncountingsimulation
  • Arrays & HashingMediumAuto-graded
    Column-wise Gap Filling with Mean, Median or Mode

    Fill None cells in a table column by column with the mean, median or smallest-most-frequent value of the observed entries, without mutating the input.

    Arrays & Hashingarrayssimulationstatisticsdata-cleaning
  • StringsMediumAuto-graded
    Longest Repeat-Free Concatenation, Lexicographically Smallest

    Pick words and order them to form the longest string with no repeated character, breaking ties by smallest lexicographic order; tests subset backtracking with disjoint-set pruning.

    Stringsbacktrackingsubsetsstringsbitmask
  • Trees & GraphsMediumAuto-graded
    Uncover Cells on a Minefield Grid with Flood Expansion

    Apply a Minesweeper-style tap to a grid, expanding through zero-mine regions with breadth-first search and labeling cells with adjacent mine counts.

    Trees & Graphsbfsgridmatrixsimulation
  • Data Structure DesignMediumAuto-graded
    Restaurant Queue Tracker with Fast Rank Lookup

    Replay a list of queue operations on a first-come waitlist, supporting add, remove-by-id, rank lookup and front peek, with rank queries faster than a linear scan.

    Data Structure Designdesignorder-statistictreaphash-map
  • Trees & GraphsMediumAuto-graded
    Grid Distance to the Closest Marked Cell

    Compute, for every cell of a grid, the fewest orthogonal steps to the closest marked cell, using a single multi-source breadth-first search; -1 everywhere when no cell is marked.

    Trees & Graphsbfsmulti-source-bfsgridshortest-path
  • Math & Bit ManipulationHardAuto-graded
    Ordered IPv4 Access List: Verdict for an Address or Entire Subnet

    Evaluate an ordered first-match IPv4 access list for a single address or a whole CIDR block, which needs prefix arithmetic and interval reasoning rather than enumerating addresses.

    Math & Bit Manipulationcidrbit-manipulationstacksorting
  • Trees & GraphsMediumAuto-graded
    Chained Exchange Rates: Resolve Conversion Queries

    Build a bidirectional weighted graph from exchange rates and answer conversion queries with a deterministic BFS that multiplies rates along the first-found path, or -1.0 if none exists.

    Trees & Graphsgraphbfsweighted-graphhash-map
  • Math & Bit ManipulationEasyAuto-graded
    Expected Draws Until a Second Distinct Token Shows Up

    Compute, as a floating-point number, the expected number of draws from a fixed three-outcome distribution until two different outcomes have appeared, using conditioning and geometric waiting times.

    Math & Bit Manipulationprobabilityexpected-valuegeometric-distributionmath
  • SQL & DataEasyAuto-graded
    Creator Reach Score and Monthly New-Follower Trends

    Join and aggregate social-graph records to compute per-user reach scores and per-month follower statistics, including previous-month lookups, growth rates and running totals.

    SQL & Dataaggregationjoinswindow-functionshash-map
  • Arrays & HashingHardAuto-graded
    Complete a Partially Filled Number Grid with Row, Column, Box Rules

    Fill in the blanks of a 9x9 digit grid so every row, column and 3x3 block holds each digit 1-9 once, testing backtracking with constraint pruning.

    Arrays & Hashingbacktrackingconstraint-satisfactionbitmaskrecursion
  • Arrays & HashingMediumAuto-graded
    Rainwater Held Between Terrain Columns

    Compute total rainwater stored between unit-width columns of given heights, aiming for a single pass with constant extra memory using the two-pointer technique.

    Arrays & Hashingtwo-pointersarraysgreedy
  • Dynamic ProgrammingMediumAuto-graded
    Cheapest Right-Down Route Through a Cost Grid

    Compute the minimum total cost of a route from the top-left to the bottom-right of a grid when only right and down moves are allowed, using dynamic programming.

    Dynamic Programmingdynamic-programminggridmatrixoptimization
  • Heaps, Sorting & SearchMediumAuto-graded
    Rank Anti-Diagonal Strings of a Letter Grid

    Build a string for each anti-diagonal of a letter grid, read bottom-left to top-right, and return diagonal indices ordered by string, with ties broken by index.

    Heaps, Sorting & Searchmatrixsortingstringstie-breaking
  • Trees & GraphsMediumAuto-graded
    Is the Target's Cell Forced by Every Valid Seating?

    Backtracking over placements of named items on a grid under pairwise relative-position clues, deciding whether the target ends up in one cell across all valid layouts.

    Trees & Graphsbacktrackingconstraint-satisfactiongridsearch
  • Arrays & HashingEasyAuto-graded
    Locate Two Entries That Add Up to a Goal

    Find the two distinct positions in an integer list whose values sum to a goal, using a single-pass hash map lookup instead of checking every pair.

    Arrays & Hashinghash-maparrayscomplement-lookup