KatInterview

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

Coding Interview 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 2521–2550 of 2765 results

  • 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
  • StringsMediumModel answer
    Generator-Based Parser for Structured Log Streams

    Build a memory-efficient Python generator that parses log records with timestamps and key-value pairs, handling quoted strings with escapes.

    Stringsparsinggeneratorsstring-processingtext-processing
  • 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
  • Heaps, Sorting & SearchMediumModel answer
    Budget-Constrained Selection and Graph Distance Query

    Find how many sorted items fit within a budget using prefix sums and binary search, then parse a graph and compute the shortest path between two nodes.

    Heaps, Sorting & Searchbinary-searchdijkstraprefix-sumshortest-path
  • 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
  • Data Structure DesignMediumModel answer
    Sparse Matrix Implementation with Operations

    Build a memory-efficient representation for sparse matrices and implement addition, multiplication, and display operations.

    Data Structure Designsparse-matrixdictionarymatrix-operations
  • 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
  • Heaps, Sorting & SearchMediumModel answer
    Optimal Order Fulfillment with Decaying Prices

    Determine the maximum revenue when fulfilling orders from inventory where each item's price equals its current stock level and decreases with each sale.

    Heaps, Sorting & Searchbinary-searchgreedymathpriority-queue
  • 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
  • Data Structure DesignMediumModel answer
    Real-Time List Filter with Dynamic Maximum Highlighting

    Create a filterable transaction list that automatically highlights entries with the highest amount among currently visible results.

    Data Structure Designfrontendstate-managementfilteringui-components
  • 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
  • Arrays & HashingMediumAuto-graded
    Delivery Experiment Design: Sample Size and Error Control

    Tests ability to calculate sample sizes for superiority and non-inferiority tests, apply multiple-testing corrections, adjust for clustering, and explain sequential monitoring.

    Arrays & Hashingstatisticsexperimental-designhypothesis-testingsample-size
  • Math & Bit ManipulationEasyAuto-graded
    Build the Hailstone Number Chain

    Simulating an iterative number transformation until a fixed point is reached, handling boundary conditions and large intermediate values.

    Math & Bit Manipulationsimulationiterationmathematical-sequences
  • StringsMediumAuto-graded
    Strict Numeric String Recognizer

    Tests whether candidates can implement a precise single-pass parser that accepts only well-formed integers, decimals, and scientific notation strings.

    Stringsstringsparsingtwo-pointers
  • Data Structure DesignMediumModel answer
    Contiguous Range Manager with Dynamic Resizing

    Build a system to manage named, non-overlapping contiguous ranges over a fixed ID space with dynamic resizing that minimally shifts neighbors.

    Data Structure Designrange-managementgreedyarraysystem-design
  • Data Structure DesignMediumModel answer
    Transaction Policy Engine Design and Implementation

    Build a configurable rule engine that evaluates financial transactions against spending policies and returns approval decisions in real-time.

    Data Structure Designrule-enginepolicy-evaluationsystem-designdata-structures
  • StringsEasyAuto-graded
    Generate Number Sequence with Divisibility Rules

    Tests basic control flow, modular arithmetic, and string formatting by transforming numbers according to divisibility conditions.

    Stringsconditionalsmoduloiteration
  • Arrays & HashingHardAuto-graded
    Plurality and Instant-Runoff Vote Counting

    Tests aggregated vote counting, majority detection, and iterative candidate elimination in ranked-choice systems.

    Arrays & Hashingsimulationhash-mapvoting-algorithms
  • Arrays & HashingMediumAuto-graded
    Rearrange Array to Next Greater Sequence

    Tests in-place array manipulation to transform a sequence into its immediate lexicographic successor, wrapping to the smallest arrangement when needed.

    Arrays & Hashingarrayspermutationsin-placetwo-pointers
  • Data Structure DesignMediumModel answer
    Frame-Based Media Player in JavaScript

    Build a JavaScript controller for frame-by-frame playback with play, pause, seek, and configurable FPS, handling timer accuracy and state management.

    Data Structure Designjavascripttimersclosuresapi-design
  • Dynamic ProgrammingMediumAuto-graded
    String Reversal with Contiguous Subarray Extremes

    Tests string manipulation and dynamic programming through reversing text and finding optimal contiguous subarrays by sum and product.

    Dynamic Programmingarraysstringskadanesubarray
  • StringsMediumAuto-graded
    Distribute and Expand Algebraic Products

    Tests recursive parsing, the distributive property of multiplication over addition, and constructing expanded expressions from nested operations.

    Stringsparsingrecursionstring-manipulation