KatInterview

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

Interview Practice Problems

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

5981
Problems
2215
Auto-graded
15
Topics
272
Added today

Showing 1981–2010 of 2215 results

  • Math & Bit ManipulationEasyAuto-graded
    Maximum Group Size with Shared Bit Position

    Tests ability to use bit manipulation and counting to find the largest group of numbers sharing at least one common bit.

    Math & Bit Manipulationbit-manipulationgreedycounting
  • Data Structure DesignMediumAuto-graded
    Two-Stack Document Editor with Cursor Operations

    Tests efficient implementation of a mutable text buffer with insertion, deletion, and bidirectional cursor movement using dual-stack architecture.

    Data Structure Designstacksstring-manipulationsimulation
  • Greedy & IntervalsMediumAuto-graded
    Task Assignment with Skill Matching and One Flexible Worker

    Tests greedy selection within independent groups and optimal placement of a single unrestricted resource.

    Greedy & Intervalsgreedyhash-tablesorting
  • Heaps, Sorting & SearchMediumAuto-graded
    Running Median from Integer Stream

    Tests ability to maintain order statistics efficiently in a streaming context using heap-based data structures.

    Heaps, Sorting & Searchheapsstreaming-algorithmsdata-structures
  • StringsMediumAuto-graded
    Palindromic Substring Counter

    Tests ability to identify and count all palindromic substrings using center expansion and understanding of linear-time optimization techniques.

    Stringspalindromestwo-pointersstring-matching
  • Math & Bit ManipulationHardAuto-graded
    Count Lattice Paths Avoiding Forbidden Cells

    Tests combinatorics by counting monotone lattice paths from (0,0) to (m,n) that avoid a given set of forbidden grid cells, using inclusion-exclusion over path prefixes.

    Math & Bit Manipulationcombinatoricsdynamic programmingmathbit manipulation
  • Arrays & HashingMediumAuto-graded
    Draw a Grid Chart from Coordinate Pairs

    Tests array processing, coordinate mapping, and ASCII visualization by building a bordered grid from unsorted integer coordinates.

    Arrays & Hashingarraysstringshash-mapvisualization
  • Greedy & IntervalsMediumAuto-graded
    Minimum Days to Execute Sequential Jobs with Cooldown

    Simulates executing a fixed sequence of jobs where re-running the same job requires waiting through a cooldown period.

    Greedy & Intervalsgreedyhash-mapsimulation
  • Data Structure DesignHardAuto-graded
    Build a Virtual Directory Tree with File Operations

    Design and implement a tree-based in-memory filesystem supporting directory creation, file I/O, listing, and deletion via absolute paths.

    Data Structure Designtreeshash-tablesdata-structure-designpath-traversal
  • Arrays & HashingHardAuto-graded
    Manual Gradient Computation: Cumulative Products and Softmax Loss

    Implement forward and backward passes for cumulative multiplication and stable softmax cross-entropy loss without autograd libraries.

    Arrays & Hashinggradientsbackpropagationnumerical-stabilitychain-rule
  • Arrays & HashingEasyAuto-graded
    Binomial Probability of Exactly k Successes

    Tests whether a candidate can implement the binomial PMF, including the combination factor, a bias parameter, and out-of-range edge cases.

    Arrays & Hashingprobabilitycombinatoricsmath
  • SQL & DataMediumAuto-graded
    Aggregate Sales Report from Transaction Records

    Tests the ability to perform group-by aggregation (sum, count, average) over a list of dicts, mimicking SQL GROUP BY with multiple metrics and tie-breaking output order.

    SQL & Datagroup-by aggregationdata cleaninglist of dicts
  • Data Structure DesignMediumAuto-graded
    Crawling Worm Simulation: Track Length After Each Step

    Tests precise deque-plus-set simulation of a growing worm on a grid, including the exact ordering of tail removal and collision detection.

    Data Structure Designsimulationdequehash-set
  • Stacks & QueuesHardAuto-graded
    Validate Nested Chemical Formula Expressions

    Tests deep bracket-matching with multiplicative expansion rules by validating and evaluating a chemical-formula-style string with nested parentheses and numeric multipliers.

    Stacks & Queuesstacksbracket matchingparsingsimulation
  • Arrays & HashingMediumAuto-graded
    Three-Part Coding Challenge: Justification, Wildcards, and Pathfinding

    Evaluates text formatting with precise spacing rules, wildcard-based string validation, and grid traversal with path reconstruction.

    Arrays & Hashingstringsgraphsbfsgreedy
  • SQL & DataEasyAuto-graded
    Summarize Monthly Sales by Region from Transaction Records

    Tests group-by aggregation: given a list of transaction dicts, compute total revenue and order count per region per month, returned as a sorted list of summary records.

    SQL & Datadata aggregationdictionariessorting
  • Data Structure DesignMediumAuto-graded
    Query Engine for Content Moderation Event Logs

    Build an efficient query system over sorted violation records supporting policy lookups, post lookups, and time-based aggregations using indexing and binary search.

    Data Structure Designhash-mapbinary-searchindexing
  • StringsMediumAuto-graded
    Word Lookup in a Large Lexicon

    Tests efficient membership checking using hash sets, understanding amortized preprocessing costs, and recognizing algorithmic trade-offs for large-scale lookups.

    Stringshash-tablessetsoptimizationmembership-testing
  • Arrays & HashingMediumAuto-graded
    Select Log Records Meeting Severity Criteria

    Tests understanding of ordinal comparison over structured fields versus naive text matching and proper handling of malformed input.

    Arrays & Hashingfilteringstring-handlingedge-cases
  • StringsEasyAuto-graded
    Minimum Single-Character Edits to Make a Palindrome

    Tests whether a candidate can count the minimum number of single-character insertions or deletions needed to transform a string into any palindrome.

    Stringsstringsdynamic programmingedit operations
  • Trees & GraphsMediumAuto-graded
    Identify the Nearest Shared Ancestor of Two Tree Nodes

    Tests tree reconstruction and ancestor tracking to locate the closest common parent of two given values in a binary tree.

    Trees & Graphsbinary-treetree-traversalancestor-search
  • StringsMediumAuto-graded
    Find Next Palindrome Number

    Tests string manipulation and numeric logic to determine if a number is palindromic and compute the next larger palindrome efficiently.

    Stringspalindromestring-manipulationgreedy
  • Linked ListsEasyAuto-graded
    Flatten a Linked List in K-Group Level Order

    Tests pointer manipulation by collecting nodes from a singly linked list in chunks of k, then reversing the order within each chunk's values to produce a flat list.

    Linked Listslinked listsk-group operationspointer manipulation
  • Trees & GraphsMediumAuto-graded
    Minimax Solver for 3×3 Tic-Tac-Toe with Optimal Move Selection

    Implement a recursive game-tree solver that finds the outcome under optimal play and identifies a winning or drawing move for the current player.

    Trees & Graphsrecursionbacktrackinggame-theoryminimax
  • Trees & GraphsMediumAuto-graded
    Identify Tree Roots and Trace Ancestor Paths

    Tests graph traversal, parent-pointer navigation, and root identification in tree-like structures represented as parent references.

    Trees & Graphsgraphstreeshash-mapspath-finding
  • Trees & GraphsMediumAuto-graded
    Maximum Path Bonus in a Weighted Tree

    Tests tree DP (rerooting) by finding the node from which the maximum sum of weighted edges can be collected along any single root-to-leaf path in a tree.

    Trees & Graphstreesdynamic-programmingtree-dpdepth-first-search
  • Data Structure DesignEasyAuto-graded
    Count Requests Within a Sliding Time Window

    Tests ability to implement a sliding-window rate limiter by counting how many past requests fall within a fixed-duration window ending at each query timestamp.

    Data Structure Designdata structuressliding windowrate limiter
  • Math & Bit ManipulationMediumAuto-graded
    Calculate Power Plant Economics and Renewable Breakeven

    Tests break-even analysis, contribution margin calculations, capacity constraints, and financial comparison of energy generation alternatives.

    Math & Bit Manipulationbreak-even analysisprofit calculationbusiness metrics
  • Arrays & HashingMediumAuto-graded
    Trace a Named Value Through a Chain of Symbol Bindings

    Tests whether a candidate can resolve a target symbol to its integer value by following an arbitrarily ordered, acyclic chain of name-to-name and name-to-literal bindings.

    Arrays & Hashinghash-mapstring-parsingsimulation
  • Greedy & IntervalsMediumAuto-graded
    Merge Overlapping Regions from Two Sorted Interval Lists

    Tests two-pointer traversal on sorted interval lists to find all pairwise overlaps in linear time.

    Greedy & Intervalsintervalstwo-pointerssortingarrays