practice a little every day — you've got this ♡
Coding Interview Problems
Practice 6016 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.
- 6016
- Problems
- 2229
- Auto-graded
- 15
- Topics
- 274
- Added today
Showing 781–810 of 2128 results
- Arrays & HashingMediumAuto-gradedGrid Editor: Flip Rows, Swap Rows, and Turn Clockwise
Simulate a sequence of string commands (row reversal, row swap, 90-degree clockwise turn) on a rectangular grid whose shape changes after each turn.
Arrays & Hashingmatrixsimulationstring-parsingrotation - Heaps, Sorting & SearchMediumAuto-gradedFind Frequent Elements with Custom Tie-Breaking
Count item occurrences and retrieve the top k highest-frequency elements, sorting tied elements by value ascending.
Heaps, Sorting & Searcharrayssortinghash-table - Arrays & HashingMediumAuto-gradedProduct of Two Mostly-Zero Grids
Compute the product of two mostly-zero integer matrices by precomputing nonzero positions so that no work is spent on zero operands.
Arrays & Hashingmatrixsparsesimulationhashing - Greedy & IntervalsEasyAuto-gradedMinimum Days to Complete Sequential Tasks With Daily Time Budgets
Greedy single-pass simulation: pack tasks in order into daily time budgets without splitting, and return the day count or -1 if impossible.
Greedy & Intervalsgreedysimulationtwo-pointersarrays - Stacks & QueuesMediumAuto-gradedUnscramble a Cipher-Encoded Nested Outline
Parse a parenthesized pre-order tree string with a stack and undo a letter-substitution cipher, where each node's text is the run just before its closing parenthesis.
Stacks & Queuesstackstring-parsingtree-deserializationsubstitution-cipher - Math & Bit ManipulationEasyAuto-gradedSimple OLS Linear Regression Fitting
Compute the slope and intercept for a univariate linear regression model using ordinary least squares.
Math & Bit Manipulationmatharraysstatistics - Data Structure DesignMediumAuto-gradedRolling Window Stats: Unique Senders and Peak Message Size
Replay a list of operations on a fixed-size sliding window, reporting the distinct sender count and the largest payload size after each insertion.
Data Structure Designsliding-windowdequehash-mapheap - Data Structure DesignMediumAuto-gradedPrefix-Compressed Trie for Integer Sequences
Simulate operations on a prefix-compressed radix tree storing integer sequences, supporting sequence insertions and depth-first tree serialization.
Data Structure Designradix-treetriedata-structure-designtrees - Arrays & HashingEasyAuto-gradedModular Product Exclude Current Element
Compute the modular product of all elements in an array except the current element for each index without division.
Arrays & Hashingarraysprefix-summath - Linked ListsEasyAuto-gradedReverse a Sequence of Node Values
Tests the ability to reverse a sequential list of numbers efficiently, mimicking linked list reversal operations.
Linked Listslinked-listsarrayspointers - Greedy & IntervalsMediumAuto-gradedRoom Count and Heaviest Prerequisite Chain for Sessions
Combine an interval-overlap sweep with a min-heap and a longest weighted path on a DAG using topological order.
Greedy & Intervalsintervalsmin-heaptopological-sortdag - Data Structure DesignMediumAuto-gradedEscrow-Style Ledger with Expiring Transfers and Account Merging
Simulate an in-memory ledger with held transfers that expire after a day, account merging, and a ranking of accounts by completed outgoing totals.
Data Structure Designsimulationhash-mapheapstate-management - Data Structure DesignMediumAuto-gradedRolling Mean Over the Latest K Readings
Simulate a rolling-window mean over a stream of readings, handling the warm-up phase and keeping floating-point error from accumulating across long streams.
Data Structure Designsliding-windowqueuefloating-pointsimulation - Data Structure DesignEasyAuto-gradedSimulate Rate Limiter Decisions
Simulate a thread-safe fixed-window rate limiter processing a sequence of request timestamps.
Data Structure Designdesignsimulationarrays - Greedy & IntervalsMediumAuto-gradedCompute Free Windows from Schedule Constraints
Compute unreserved time windows for specified daily schedules given opening hours and existing bookings.
Greedy & Intervalsintervalssortingstringgreedy - Arrays & HashingEasyAuto-gradedCompute Aggregate Distance Tolls for Interleaved Logs
Process interleaved time-ordered scanner events to compute cumulative segment-based charges across all entities.
Arrays & Hashinghash-maparraysimulation - Arrays & HashingMediumAuto-gradedQuickest Way to Cover a Set Distance From Per-Interval Odometer Data
Find the top average speed over any time window covering exactly a target distance, given piecewise-constant speeds. Tests prefix sums, interpolation and binary search.
Arrays & Hashingprefix-sumsbinary-searchinterpolationtwo-pointers - Greedy & IntervalsMediumAuto-gradedResolve Overlapping Text Edit Spans by Priority
Sweep over span boundaries with a heap to resolve overlapping inclusive edit spans using priority, original length, and input order, splitting losers into fragments.
Greedy & Intervalsintervalssweep-lineheaptie-breaking - Math & Bit ManipulationMediumAuto-gradedChance That Two Random Draws Multiply to More Than a Half
Compute the exact probability that the product of two independent Uniform(0,1) values exceeds 1/2, by integrating over the region of the unit square above a hyperbola.
Math & Bit Manipulationprobabilityintegrationcontinuous-distributionsclosed-form - Trees & GraphsMediumAuto-gradedSpreading Pop Wave Across a Square Balloon Grid
Compute the earliest time each cell of a square grid is reached by a wave spreading from several seed cells, using multi-source breadth-first search.
Trees & Graphsbfsgridmulti-sourceshortest-path - Heaps, Sorting & SearchMediumAuto-gradedNewest-First Transaction Pager with Offset and Cursor Modes
Build a pager over transaction records that sorts newest-first with a deterministic tie-break and supports offset and keyset-cursor navigation with correct metadata.
Heaps, Sorting & Searchsortingpaginationkeyset-cursortie-breaking - Heaps, Sorting & SearchMediumAuto-gradedFind Pair of Integers with Sum Nearest to Zero
Find a pair of distinct elements in an array whose sum has the smallest absolute value, breaking ties deterministically.
Heaps, Sorting & Searcharraysbinary-searchsortingtwo-pointers - Math & Bit ManipulationHardAuto-gradedSubset Count Under Sum Constraint and Divisor Index
Find the maximum number of elements from an array whose sum is at most a given target n, and compute the k-th smallest positive divisor of a number N.
Math & Bit Manipulationmathsortinggreedyprefix-sum - Arrays & HashingMediumAuto-gradedPaint Stacked Boxes onto a Character Grid
Simulate painting bordered, filled boxes onto a fixed-size text grid, clipping to the grid while keeping border and interior status based on the full box.
Arrays & Hashingsimulation2d-gridclippingstrings - Data Structure DesignEasyAuto-gradedSimulate a Forward-Only Row Cursor
Simulate a forward-only cursor over a list of rows, where a peek call is side-effect free and an advance call returns the next row or None at the end.
Data Structure Designsimulationiteratorcursordesign - Trees & GraphsMediumAuto-gradedVerify Root-to-Leaf Sequence in Binary Tree
Check if a list of integers forms a complete valid root-to-leaf path in a binary tree given as an adjacency table.
Trees & Graphstrees-graphstreearray - Arrays & HashingEasyAuto-gradedFill a Grid With Connected Crop Strips in Snake Order
Build an N by M grid in which each crop forms one edge-connected region, using a snake-order fill with a fixed, deterministic output.
Arrays & Hashinggridconstructionsimulationserpentine - Stacks & QueuesEasyAuto-gradedStack Simulator with Constant-Time Minimum Queries
Simulate a sequence of stack commands and answer minimum queries in constant time by tracking the running minimum alongside each element.
Stacks & Queuesstackdesignsimulationauxiliary-stack - Data Structure DesignHardAuto-gradedRunning Bit-Entropy of a Token Feed with Stable Updates
Maintain Shannon entropy of a growing token stream with constant-time updates and queries, avoiding catastrophic cancellation when one token dominates.
Data Structure Designstreamingnumerical-stabilityhash-mapentropy - Arrays & HashingEasyAuto-gradedMost Frequent Log Error Codes in Time Interval
Filter log entries within a half-open time interval, compute occurrence frequencies, and retrieve the top k error codes sorted by frequency and string order.
Arrays & HashingArrays & HashingSortingHash Table