KatInterview

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

Coding Interview Problems

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

6021
Problems
2229
Auto-graded
15
Topics
272
Added today

Showing 1261–1290 of 2128 results

  • Data Structure DesignMediumAuto-graded
    Simulated Word Store with Prefix Query

    Tests trie-style prefix counting logic via operation replay, with optional case-insensitive and trailing-digit normalization flags.

    Data Structure Designtriestringssimulation
  • Heaps, Sorting & SearchMediumAuto-graded
    Find k Nearest Values in Sorted Array

    Tests binary search on window positions with careful tie-breaking that prefers smaller values when distances are equal.

    Heaps, Sorting & Searchbinary-searchsliding-windowtwo-pointers
  • Data Structure DesignHardAuto-graded
    Running Median Over a Live Integer Feed

    Tests whether a candidate can design a two-heap structure that inserts integers and queries the running median in better than O(N) time per operation.

    Data Structure Designheapsdesignstreaming
  • Trees & GraphsMediumAuto-graded
    Count Land Cells in a Connected Region

    Tests iterative graph traversal (DFS/BFS) on a binary grid, including bounds handling, visited-marking strategy, and complexity analysis.

    Trees & Graphsgraph traversalDFSBFSmatrix
  • Arrays & HashingEasyAuto-graded
    Aggregate Parallel Pipeline Results Safely

    Fix async pool usage so results are collected in order, worker errors surface, and one JSON file is written.

    Arrays & Hashingmultiprocessingconcurrencydebuggingfile-io
  • Arrays & HashingMediumAuto-graded
    Compress Sorted Array to Unique Elements

    Tests in-place array manipulation with two-pointer technique to remove duplicates from a sorted sequence.

    Arrays & Hashingtwo-pointersin-placesorted-array
  • Data Structure DesignMediumAuto-graded
    Mini Query Engine: Filter, Sort, and Project Rows

    Tests ability to implement a pipeline of filter, multi-column sort, and column projection over a list of in-memory row dicts.

    Data Structure Designdata structuressortingfiltering
  • Heaps, Sorting & SearchMediumAuto-graded
    Weighted Lottery Ticket Assignment

    Tests prefix sums and binary search to map ticket numbers into population-weighted ranges efficiently.

    Heaps, Sorting & Searchbinary-searchprefix-sumsarrays
  • Heaps, Sorting & SearchMediumAuto-graded
    Sorted Sensor Readings: Answer Interval Coverage Queries

    Tests binary search on sorted arrays with duplicates to answer multiple inclusive range queries in O(log n) per query.

    Heaps, Sorting & Searchbinary-searcharraystwo-pointers
  • Heaps, Sorting & SearchMediumAuto-graded
    Find the K-th Largest Element Without Using a Heap

    Tests implementation of quickselect to find the k-th largest value in an unsorted array, treating duplicates as separate elements.

    Heaps, Sorting & Searchquickselectpartitioningselection-algorithms
  • Trees & GraphsMediumAuto-graded
    Bottleneck Path Under an Edge-Weight Cap

    Tests whether a candidate can find the minimax-cost path in a filtered graph, recognising that one edge attribute gates inclusion while another drives the optimisation.

    Trees & Graphsgraphdijkstraminimaxshortest-path
  • Arrays & HashingMediumAuto-graded
    Three-Dice Payout: Expected Value by Match Type

    Tests ability to count outcome classes for three N-sided dice and combine probability-weighted payoffs into an expected value, including a sign-flip variant.

    Arrays & Hashingexpected-valueprobabilitycounting
  • Data Structure DesignMediumAuto-graded
    Bounded Cache with Least-Recently-Used Eviction

    Simulate a capacity-limited key–value cache where lookups and writes both refresh recency and the oldest entry is evicted on overflow.

    Data Structure Designhash-maplinked-listcachesimulation
  • StringsMediumAuto-graded
    Letter Tile Scorer for a Word-Guessing Game

    Tests whether you can implement a precise per-letter color-scoring rule — including count-limited yellow matching — across a list of guesses against a fixed target word.

    Stringsstringsarrayshashing
  • Math & Bit ManipulationEasyAuto-graded
    Compute Tax Using Marginal Brackets

    Tests understanding of piecewise rate application and interval-based accumulation in a tiered tax system.

    Math & Bit Manipulationsimulationmathiteration
  • Trees & GraphsMediumAuto-graded
    Letter Access Sets Through a Dependency Graph

    Tests topological processing of a DAG where each node computes an active letter set from its parents' resolved sets plus its own additions and removals.

    Trees & Graphstopological-sortbit-manipulationgraph
  • Arrays & HashingMediumAuto-graded
    K-Means Clustering: Assignment, Update, and Convergence

    Tests ability to implement the full k-means loop — initialization, Euclidean assignment, centroid update, convergence check, and empty-cluster handling — in plain Python.

    Arrays & Hashingclusteringiterative-algorithmsnumerical
  • Arrays & HashingMediumAuto-graded
    Align Time Series with Linear Interpolation

    Tests piecewise-linear interpolation, binary search, and boundary handling for sampling two time series at common timestamps.

    Arrays & Hashinginterpolationbinary-searchtime-series
  • Trees & GraphsMediumAuto-graded
    Flood Fill with Step Budget on an 8-Connected Grid

    Tests BFS-based grid traversal by counting distinct empty cells reachable from a starting position within a fixed number of 8-directional moves.

    Trees & Graphsbfsgridgraph-traversal
  • Greedy & IntervalsMediumAuto-graded
    Union Length of Half-Open Integer Intervals

    Merge overlapping half-open intervals to return the total length covered by at least one interval.

    Greedy & Intervalsintervalssortingsweep-linemerge
  • Arrays & HashingMediumAuto-graded
    Profit, Collinearity, and Identity Merging in Three Parts

    Tests one-pass array scanning, integer-arithmetic collinear point detection, and union-find graph component grouping in a single combined function.

    Arrays & Hashingarraysmathunion-find
  • Dynamic ProgrammingMediumAuto-graded
    Minimum Coins to Reach a Money Amount

    Tests dynamic programming on a coin-change problem where decimal monetary values must be safely converted to integers before solving.

    Dynamic Programmingdynamic-programmingdecimal-precisioncoin-change
  • StringsMediumAuto-graded
    Reversible String List Serializer

    Tests whether a candidate can design a lossless encode/decode round-trip for arbitrary strings without relying on a fixed delimiter character.

    Stringsstringsserializationencoding
  • Trees & GraphsEasyAuto-graded
    Tree Traversal with Depth Tracking

    Tests your ability to perform pre-order depth-first traversal on a tree structure and track hierarchical depth for each node.

    Trees & Graphstree-traversaldfsdepth-tracking
  • Data Structure DesignMediumAuto-graded
    Batch Spreadsheet Cell Evaluator with Cycle Rejection

    Simulate setting and reading spreadsheet cells whose values are integers or sums of references, evaluating lazily and rejecting updates that would form cycles.

    Data Structure Designgraphscycle-detectionexpression-evaluationdependency-tracking
  • Trees & GraphsMediumAuto-graded
    Shared Root of Two Nodes in a Binary Search Tree

    Tests whether a candidate can exploit BST ordering to locate the deepest node that is an ancestor of both targets without searching the entire tree.

    Trees & Graphsbinary-search-treelowest-common-ancestortree-traversal
  • Trees & GraphsMediumAuto-graded
    Left and Right View of a Binary Tree Using BFS and DFS

    Tests understanding of binary tree traversal by computing boundary nodes at each depth using both breadth-first and depth-first strategies.

    Trees & Graphsbinary-treebfsdfstree-traversal
  • Heaps, Sorting & SearchHardAuto-graded
    Minimum Lexicographic Sequence with Precedence Constraints

    Find the smallest valid ordering of numbered items when some must precede others, or detect when circular dependencies make ordering impossible.

    Heaps, Sorting & Searchtopological-sortgraphheapgreedy
  • Dynamic ProgrammingMediumAuto-graded
    Largest Sum in Any Consecutive Sequence

    Tests understanding of dynamic programming through finding the maximum sum achievable by selecting adjacent elements from an array.

    Dynamic Programmingarrayskadanesubarrayoptimization
  • Data Structure DesignMediumAuto-graded
    Freelance Crew Pay Tracker With Rolling Settlements

    Tests the ability to design an in-memory ledger class driven by an operation list, maintaining running cost totals and an idempotent pay-cutoff pointer.

    Data Structure Designdesignsimulationhash-map