practice a little every day — you've got this ♡
Coding Interview Problems
Practice 5972 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.
- 5972
- Problems
- 2212
- Auto-graded
- 15
- Topics
- 273
- Added today
Showing 91–120 of 2112 results
- Heaps, Sorting & SearchMediumAuto-gradedGreedy Tile Placement Across Parallel Lanes
Simulate placing items one by one into the currently lowest lane, breaking ties by lowest index, and report each lane's final total using a min-heap.
Heaps, Sorting & Searchheapgreedysimulationpriority-queue - Trees & GraphsMediumAuto-gradedMinimum Rides Across Circular Shuttle Lines
Find the fewest shuttle lines to board to get from one stop to another, using a graph search over lines and a stop-to-lines index to stay linear in total stops.
Trees & Graphsbfsgraphhash-mapshortest-path - Greedy & IntervalsMediumAuto-gradedCanonical Path Cleanup Plus Overlapping Range Union
Combine stack-based Unix path normalization with sort-and-sweep merging of overlapping or touching closed ranges, returning both results in one list.
Greedy & Intervalsstacksortingintervalsstrings - Arrays & HashingMediumAuto-gradedShortest Total Flight on a Circular Track of Stations
Sum the shortest arc distances between consecutive stops on a ring with weighted edges, using prefix sums for O(1) arc queries.
Arrays & Hashingprefix-sumcircular-arraysimulation - Trees & GraphsMediumAuto-gradedEdge Silhouettes of a Level-Order Binary Tree
Build a binary tree from a level-order list with gaps and report the first and last node of every level, testing BFS level separation and level-order parsing.
Trees & Graphsbinary-treebfslevel-ordertree-construction - Arrays & HashingHardAuto-gradedIdentify Most Popular Three-Page User Sequence
Process website activity logs to compute chronological 3-site visit subsequences and find the most widely performed pattern across unique users.
Arrays & Hashingarrayshash-tablesortingsubsequence - Data Structure DesignMediumAuto-gradedArticle Reaction Ledger with Recent Reversal Log
Simulate a stream of up/down/clear reactions on articles, maintaining net scores and a bounded log of the three most recent reversals per article, all in constant time per operation.
Data Structure Designhash-mapdequesimulationstate-tracking - Arrays & HashingEasyAuto-gradedRank Companion Items by Shared Collections
Count how often each item shares a collection with a target item, then rank by count descending and name ascending, with an optional cap on the result length.
Arrays & Hashinghash-mapcountingsortingco-occurrence - Math & Bit ManipulationMediumAuto-gradedExpected Matching-Rank Pairs in a Random Card Hand
Compute the expected number of same-rank card pairs in a hand drawn without replacement, using linearity of expectation over pairs of cards.
Math & Bit Manipulationprobabilityexpectationcombinatoricslinearity-of-expectation - StringsMediumAuto-gradedMinimal Distinguishing Abbreviations for a Word List
Compute, for each word, the shortest leading substring shared with no other entry, using prefix counting or a trie, and return the whole word when none exists.
Stringstrieprefixhash-mapstrings - Trees & GraphsMediumAuto-gradedFewest Rolls to Park a Sliding Ball in a Grid
Model a sliding ball as BFS over resting positions, where each edge is a full roll until a wall or border, and the target counts only if the ball stops on it.
Trees & Graphsbfsgridgraphshortest-path - Data Structure DesignEasyAuto-gradedRunning Tally per Label from a Replayed Call Log
Replay a log of increment calls and report, for each call, how many times its key has appeared so far, testing hash map counting and a simple operation-dispatch design.
Data Structure Designhash-mapsimulationdesigncounting - Data Structure DesignMediumAuto-gradedFixed-Size Ring Buffer Command Simulator
Simulate a bounded FIFO ring buffer driven by a list of commands, handling wrap-around, full and empty states, and returning each command's result in order.
Data Structure Designdesignqueuering-buffersimulation - Greedy & IntervalsHardAuto-gradedShared High-Activity Windows Across Sensor Feeds
Merge step-function sensor feeds with a sweep over status-change events to find every maximal inclusive window in which all feeds are at or above a level.
Greedy & Intervalssweep-lineintervalsstep-functionbinary-search - Math & Bit ManipulationEasyAuto-gradedBinomial and Poisson Rare Event Tail Probabilities
Computes the exact binomial tail probability P(X > k) and its Poisson approximation parameterised by lambda = n * p.
Math & Bit Manipulationmathstatisticsprobability - Arrays & HashingMediumAuto-gradedThree-Bucket Rearrangement With Constant Extra Space
Tests in-place three-way partitioning of an array holding only 0, 1 and 2 using constant extra space and a single linear pass, with careful pointer invariants.
Arrays & Hashingtwo-pointersin-placepartitioningsorting - Data Structure DesignMediumAuto-gradedExpense Reimbursement Ledger Simulator
Simulate an expense tracking ledger executing sequential API calls with validation and error checks.
Data Structure Designdesign-dsarrayshash-table - Trees & GraphsEasyAuto-gradedVerify Root Sequence Match in N-ary Tree
Determine if a given target sequence matches a top-down path in an N-ary tree represented by nested dictionaries.
Trees & Graphstrees-graphsrecursiondfstree-traversal - Greedy & IntervalsMediumAuto-gradedCollapse Booked Time Ranges Into Disjoint Blocks
Combine closed integer ranges that overlap or share an endpoint into disjoint blocks, tests sorting plus a single sweep and careful boundary handling.
Greedy & Intervalsintervalssortinggreedysweep - Data Structure DesignMediumAuto-gradedNested Undo-Log Session Store with Value Tallies
Simulate an in-memory key-value store with nested transactions, a global commit, and a live per-value key tally, processing a batch of operations and returning each result.
Data Structure Designhash-mapundo-logtransactionssimulation - Trees & GraphsMediumAuto-gradedCounting Separate Land Patches in a 0/1 Grid
Count connected components of 1-cells in a binary grid using only up/down/left/right adjacency, via flood fill or union-find.
Trees & Graphsgraphbfsconnected-componentsmatrix - Arrays & HashingMediumAuto-gradedRepeat Visitors Across UTC Days in an Event Feed
Normalize ISO 8601 timestamps to UTC dates and use hashing to find users active on at least two distinct UTC calendar days.
Arrays & Hashinghashingdatetimetimezonelogs - Math & Bit ManipulationMediumAuto-gradedCover an IPv4 Address Run with the Fewest Prefix Blocks
Split a run of consecutive IPv4 addresses into the fewest aligned power-of-two prefix blocks using 32-bit integer and lowest-set-bit reasoning.
Math & Bit Manipulationbit-manipulationgreedyipv4cidr - Arrays & HashingMediumAuto-gradedLongest Daily Purchase Streak for Each Customer
Group purchase records by customer, collapse same-day duplicates, and find the longest run of back-to-back calendar days, reporting results sorted by customer id.
Arrays & Hashinghashingsortingdatesgaps-and-islands - Trees & GraphsMediumAuto-gradedSmallest-Label Build Sequence with Cycle Check
Produce the lexicographically smallest valid ordering of a dependency graph using a min-heap variant of Kahn's algorithm, returning an empty list if a cycle makes ordering impossible.
Trees & Graphstopological-sortheapgraphcycle-detection - Greedy & IntervalsMediumAuto-gradedSmallest-ID Room Allocation for Booking Time Slots
Partition half-open time intervals across the fewest resources, deterministically giving each booking the lowest-numbered free resource, using sorting and two heaps.
Greedy & Intervalsintervalsheapgreedysorting - Data Structure DesignMediumAuto-gradedSimulate an Expiring Key-Value Store with Read-Through Loads
Simulate a time-aware key-value store with expiry, stale entries that stay stored, and a read-through fetch whose loader outcome is given as data, with strict input validation.
Data Structure Designsimulationhash-mapcachevalidation - Data Structure DesignMediumAuto-gradedCanvas Replay with Undo and Redo History
Simulate a pixel canvas with draw, erase, flood fill, undo and redo, returning a canvas snapshot after every command while keeping the history stacks consistent.
Data Structure Designstacksimulationflood-fillundo-redo - Trees & GraphsMediumAuto-gradedCollect Path-Tagged Errors from a Nested Payload Schema Check
Recursively walk a JSON-like value alongside a simplified schema and report type and missing-key errors with exact paths, in deterministic order.
Trees & Graphsrecursiondfsjsonvalidation - Trees & GraphsMediumAuto-gradedCount Node Changes Between Two Keyed Hierarchies
Compare two keyed trees in parallel and count changed nodes, where a changed value replaces its whole subtree and unmatched nodes count with their subtrees.
Trees & Graphstreedfshash-mapsubtree-size