KatInterview

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

Coding Interview Problems

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

6014
Problems
2228
Auto-graded
15
Topics
273
Added today

Showing 811–840 of 2781 results

  • StringsEasyAuto-graded
    Match Words to a Keypad Number Sequence

    Given a word list and a string of keypad digits, return the sorted words whose letters map to exactly that digit sequence, testing string encoding and filtering.

    Stringsstringshashingsortingsimulation
  • Arrays & HashingMediumAuto-graded
    Count Disjoint Pairs That Add Up to a Goal Value

    Find the most disjoint pairs in an integer list whose sum equals a goal, using value counts or sorting with two pointers, while handling duplicates, negatives and the half-goal case.

    Arrays & Hashinghash-maptwo-pointersgreedycounting
  • Data Structure DesignMediumModel answer
    Build a Bucketed Spatial Index for Planar Points

    Implement a region quadtree that stores 2D points in capacity-limited buckets, splits into four quadrants on overflow, and answers rectangular range queries efficiently.

    Data Structure Designquadtreespatial-indexrecursionrange-query
  • Heaps, Sorting & SearchMediumAuto-graded
    Locate the K-th Dominant Value

    Find the k-th largest integer in an unsorted list efficiently using quickselect or priority queues.

    Heaps, Sorting & Searchheaps-sortingarraysquickselect
  • Heaps, Sorting & SearchMediumAuto-graded
    Find Unique Combination Triples for Target Sum

    Find all distinct non-decreasing 3-element value combinations in an array that add up to a specified target value.

    Heaps, Sorting & Searcharrayssortingtwo-pointers
  • Stacks & QueuesMediumAuto-graded
    Validate Deep Structure Equivalence

    Recursively or iteratively check if two arbitrarily nested data structures are identical in type, shape, and value.

    Stacks & Queuesrecursionstackdata-structureshashing
  • Data Structure DesignMediumModel answer
    Build a Bounded Permit Task Execution Engine

    Implement a concurrency manager that controls variable permit usage per task, supports blocking and asynchronous execution, and guarantees safe permit releases.

    Data Structure Designconcurrencysynchronizationdesign-dsthreading
  • Dynamic ProgrammingMediumAuto-graded
    Pair Workers With Distinct Stations at Minimum Grid Distance

    Match each point in one list to a different point in a larger list so the total Manhattan distance is minimal, which suits a bitmask DP given the small limits.

    Dynamic Programmingbitmask-dpassignment-problemmanhattan-distance
  • Trees & GraphsMediumModel answer
    Feature Flag Rollout Validator with Dependency Cycle Detection

    Parse feature dependency specs, run modular checksum verification, and evaluate user eligibility and feature graph dependencies while handling cyclic rollouts.

    Trees & Graphstrees-graphsstringsdepth-first-search
  • Data Structure DesignMediumModel answer
    Build a Biased Index Picker Using Cumulative Totals

    Design a class that returns an index at random with probability proportional to its weight, then explain how to make each draw fast and how to handle updates.

    Data Structure Designprefix-sumbinary-searchrandom-samplingfenwick-tree
  • StringsMediumModel answer
    Java Code Review: Refactoring a CSV Generator

    Analyze a poorly designed Java method for generating CSV strings and detail performance, RFC 4180 compliance, memory usage, and security enhancements.

    Stringscode-reviewjavastringscsv
  • Arrays & HashingMediumAuto-graded
    Count Maximum Disjoint Pairs Summing to a Target

    Find the most index-disjoint pairs in an integer array whose values add up to a target, testing hashing of complements, counting, and handling of the self-pairing case.

    Arrays & Hashinghash-mapcountingtwo-pointersgreedy
  • Trees & GraphsHardModel answer
    Topological Task Scheduler and Strict Expression Parser

    Solve a task dependency ordering problem via topological sort and build an expression evaluator supporting custom operator precedence, unary signs, and overflow checks.

    Trees & Graphstopological-sortgraph-algorithmsexpression-parserstacks
  • Stacks & QueuesEasyAuto-graded
    Cancel Neighboring Letter Pairs in a String

    Tests using a stack to repeatedly cancel adjacent equal characters in a string, including cascading cancellations, in linear time.

    Stacks & Queuesstackstringsimulation
  • Data Structure DesignMediumModel answer
    Trailing-Day Campaign CTR over Two Skewed Event Feeds

    Build a generator that emits per-campaign impression, click and CTR figures over a trailing 24-hour window, counting one click per impression and accepting events up to 10 minutes late.

    Data Structure Designstreamingsliding-windowheaphash-map
  • Stacks & QueuesMediumAuto-graded
    Per-Function Self Time from a Call Trace

    Sweep a single-threaded call trace with a stack to total each function's self time under half-open intervals, with recursion, strict validation, and name-sorted output.

    Stacks & Queuesstacksimulationhash-mapvalidation
  • StringsEasyAuto-graded
    Earliest Non-Repeating Symbol Position

    Locate the index of the earliest symbol in an alphanumeric string that occurs only once, using frequency counting and an ordered scan, or return -1.

    Stringshash-mapcountingstringtwo-pass
  • Heaps, Sorting & SearchMediumAuto-graded
    Simulate Multi-Timer Expiry with Single System Timer

    Simulate the execution and triggering order of multiple scheduled timers using a min-heap under system clock advancements.

    Heaps, Sorting & Searchheappriority-queuedesignsimulation
  • Data Structure DesignMediumModel answer
    Proportional Random Index Picker with Fast Repeated Queries

    Design a class that returns a random index with probability proportional to its weight, optimized for many repeated draws after one-time setup.

    Data Structure Designprefix-sumsbinary-searchrandom-samplingfenwick-tree
  • Trees & GraphsMediumAuto-graded
    Determine Build Task Schedule

    Find a valid topological sequence for tasks with prerequisite constraints or detect cyclic dependencies.

    Trees & Graphsgraphtopological-sortbfsdfs
  • StringsEasyAuto-graded
    Run Strings Through a Two-Letter State Machine

    Simulate a partial deterministic automaton over the letters a and b, handling missing transitions, invalid symbols and empty input, and report acceptance for a batch of query strings.

    Stringssimulationhash-mapstate-machinestrings
  • Dynamic ProgrammingMediumAuto-graded
    Smallest Fully Bracketed Arithmetic Expression Hitting a Target

    Enumerate all operator and bracket choices over an ordered list of numbers and return the ASCII-smallest canonical expression that evaluates to the target, or an empty string.

    Dynamic Programmingrecursioninterval-dpexpression-treesmemoization
  • Data Structure DesignMediumAuto-graded
    Design an In-Memory Reservation Manager

    Implement an in-memory venue reservation system supporting quick seat allocation, cancellation tracking, and capacity queries.

    Data Structure Designhash-tabledesignstacksdata-structures
  • Math & Bit ManipulationEasyAuto-graded
    Five Quick Quantitative Puzzles with Exact String Answers

    Solve five short arithmetic and algebra puzzles (units, compounding percentages, linear system, rate, series scaling) and return them in an exact string format.

    Math & Bit Manipulationmatharithmeticalgebraunit-conversion
  • StringsMediumAuto-graded
    Longest Window Where Every Letter Meets a Minimum Count

    Find the longest contiguous substring in which every letter that appears occurs at least k times, using a sliding window or divide and conquer.

    Stringssliding-windowstringshash-mapdivide-and-conquer
  • Data Structure DesignMediumModel answer
    Const Pointer Variants and Choosing Between Tree and Hash Maps in C++

    Explain how const placement changes pointer and pointee mutability in C++, then compare std::map and std::unordered_map on structure, complexity, ordering, key needs and use cases.

    Data Structure Designcppconst-correctnesspointersstd-map
  • Math & Bit ManipulationMediumAuto-graded
    Approximate a Square Root to the Nearest Tenth

    Compute the square root of a non-negative number without a built-in root function and return it rounded to one decimal place, using bisection or Newton's method.

    Math & Bit Manipulationbinary-searchnumerical-methodsfloating-pointmath
  • Data Structure DesignHardModel answer
    Build a Jungle Board Game Engine with Class Hierarchies

    Design the classes for a two-player Jungle (Dou Shou Qi) engine: eight animals, a 9x7 board with water, traps and dens, capture and jump rules, a small API, and tests.

    Data Structure Designobject-oriented-designgame-enginepolymorphismclass-design
  • Data Structure DesignMediumModel answer
    Build a Keyed Task Dispatcher with Global Concurrency Cap

    Design a component that runs tasks in strict order per key, lets different keys run in parallel up to a global limit, and stays correct under concurrent submits and task failures.

    Data Structure Designconcurrencythread-safetyexecutorqueues
  • Math & Bit ManipulationEasyAuto-graded
    Possible Subspace Intersection Dimensions

    Computes all valid integer dimensions for the intersection of two vector subspaces given ambient and subspace dimensions.

    Math & Bit Manipulationmathlinear-algebra