KatInterview

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

Coding Interview Problems

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

5985
Problems
2218
Auto-graded
15
Topics
271
Added today

Showing 2491–2520 of 2769 results

  • Math & Bit ManipulationHardModel answer
    Build an IP Address Calculator Without Libraries

    Create a utility to parse, compute offsets, and analyze CIDR blocks for IPv4 and IPv6 addresses using integer arithmetic, no networking libraries allowed.

    Math & Bit Manipulationbit-manipulationparsingnetworkinginteger-arithmetic
  • Data Structure DesignMediumModel answer
    Build a Rule-Based Board Game State Manager

    Design an immutable, thread-safe game engine with pluggable validation rules for a turn-based strategy game.

    Data Structure Designobject-oriented-designimmutabilitystrategy-patternconcurrency
  • Arrays & HashingMediumAuto-graded
    Find Dictionary with Extreme Field Value

    Tests your ability to scan a collection of sparse dictionaries and retrieve the one with the minimum or maximum value for a specified field.

    Arrays & Hashingdictionariesfilteringiteration
  • Math & Bit ManipulationMediumAuto-graded
    Positive Divisors of N² via Prime Factorization of N

    Tests whether a candidate can reduce a unit-fraction equation to a divisor-counting problem using algebraic factoring and number theory.

    Math & Bit Manipulationnumber-theorydivisorsprime-factorization
  • Heaps, Sorting & SearchMediumAuto-graded
    Find Leftmost Position Meeting Threshold

    Tests understanding of lower-bound binary search with correct boundary handling and duplicate treatment.

    Heaps, Sorting & Searchbinary-searchboundariesduplicates
  • Arrays & HashingMediumAuto-graded
    Find Optimal Discount from Multiple Promotion Types

    Tests ability to compare multiple discount strategies with different application rules and select the best outcome while handling edge cases like empty inputs and clamping.

    Arrays & Hashingsimulationgreedymath
  • Arrays & HashingMediumAuto-graded
    Build Alternating Color Bands for a Trail Map API

    Tests iteration logic for splitting a sequence into overlapping chunks with alternating properties

    Arrays & Hashingiterationchunkingapi-design
  • Dynamic ProgrammingHardAuto-graded
    Best Profit from One or Two Stock Transactions

    Tests dynamic programming and greedy strategies to compute optimal profit from array-based buy/sell scheduling with transaction limits.

    Dynamic Programmingarraysgreedystate-machineoptimization
  • Dynamic ProgrammingMediumAuto-graded
    Optimize Work Schedule with Limited Day Swaps

    Tests dynamic programming with state tracking to maximize earnings from daily pay and streak bonuses while converting limited off-days to work-days.

    Dynamic Programmingdynamic-programmingstate-machineoptimization
  • Data Structure DesignMediumAuto-graded
    Reverse Trie for Ending Pattern Queries

    Tests understanding of tries and the insight that suffix matching becomes prefix matching when strings are reversed.

    Data Structure Designtriestring-matchingdata-structures
  • Data Structure DesignMediumAuto-graded
    In-Memory Store with Nested Transaction Support

    Tests your ability to implement layered state management with nested scopes, tombstone deletion tracking, and atomic commit/rollback semantics.

    Data Structure Designhash-tablestackstate-management
  • Math & Bit ManipulationHardAuto-graded
    Minimum Perfect Squares to Sum to Target

    Tests understanding of number theory and optimal algorithms for decomposing integers into sums of perfect squares.

    Math & Bit Manipulationnumber-theorymathoptimization
  • StringsMediumAuto-graded
    Maximum Span with Limited Character Variety

    Tests ability to apply two-pointer sliding window technique with hash map tracking to efficiently find optimal substring boundaries.

    Stringssliding-windowtwo-pointershash-map
  • Arrays & HashingMediumAuto-graded
    Sequential Robot Navigation on a Bounded Grid

    Tests state-machine simulation with coordinate systems, directional rotation logic, boundary checking, and collision detection between sequentially deployed agents.

    Arrays & Hashingsimulationstate-machinegrid-navigation
  • 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
  • Data Structure DesignMediumModel answer
    Binary Protocol for String Dictionary Persistence

    Build a binary encoder and decoder for string dictionaries with strict validation of format integrity, size bounds, and key ordering.

    Data Structure Designserializationbinary-protocolsvalidationdata-structures
  • 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
  • Data Structure DesignMediumModel answer
    Build Directory Tree Operations with Path Parsing

    Implement directory creation and listing for an in-memory hierarchical structure with automatic parent creation and path normalization.

    Data Structure Designtreetriepath-parsingstring-manipulation
  • 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
  • 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
  • Data Structure DesignMediumModel answer
    Ad Targeting Engine and Route Optimization

    Build an ad matcher with inverted indexes and a delivery router using shortest-path precomputation plus TSP heuristics.

    Data Structure Designindexinggraphsoptimizationtrade-offs
  • 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