practice a little every day — you've got this ♡
Coding Interview Problems
Practice 6029 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.
- 6029
- Problems
- 2232
- Auto-graded
- 15
- Topics
- 274
- Added today
Showing 961–990 of 2131 results
- Data Structure DesignMediumAuto-gradedSimulate a Topic Message Broker with Subscription Tokens
Simulate a topic-based message broker from a command log, handling token issuance, ordered delivery records, and idempotent unsubscribes.
Data Structure Designdesignhash-mapsimulationordering - Stacks & QueuesMediumAuto-gradedRebuild Call Start/Stop Events from Stack Snapshots
Diff consecutive call-stack snapshots by longest common prefix to produce correctly ordered start and end events, including recursion, empty stacks and final closing.
Stacks & Queuesstacksimulationlongest-common-prefixarrays - Linked ListsMediumAuto-gradedFlip Every Block of K Consecutive Values in a Sequence
Reverse each full consecutive block of k elements in a list of values, leaving a short trailing remainder untouched, using the pointer-based linked-list technique.
Linked Listslinked-listin-placepointerssimulation - Arrays & HashingMediumAuto-gradedPrice Card Payments with Tiered Rates and Running Merchant Totals
Parse comma-separated payment rows, build a per-row rate from several rules plus a per-merchant running total, and round fees exactly to whole cents.
Arrays & Hashinghash-mapparsingsimulationrounding - Math & Bit ManipulationMediumAuto-gradedDelta-Method Variance of a Ratio of Two Sample Means
Apply a first-order Taylor expansion to get the approximate variance of a ratio of two correlated sample means, including the covariance term.
Math & Bit Manipulationdelta-methodvariancecovarianceratio-metrics - Math & Bit ManipulationMediumAuto-gradedGap in Days Between Two Calendar Strings Without Date Libraries
Parse two ISO-style date strings and compute the absolute day gap using manual Gregorian leap-year logic, without any date or calendar library.
Math & Bit Manipulationdate-arithmeticleap-yearstring-parsingmath - Arrays & HashingMediumAuto-gradedFind Accounts With Five Distinct Contacts in a Week
Sliding-window distinct counting per group: find callers who reach at least five different receivers within any 7-day span of their call log.
Arrays & Hashingsliding-windowhash-mapgroupingtimestamps - Data Structure DesignMediumAuto-gradedWork Queue Tracker with Owners, Closing, and Late Lookups
Simulate a task tracker driven by a list of operations, handling creation, reassignment, completion, and multi-key sorted queries while returning one result per operation.
Data Structure Designdesignhash-mapsortingsimulation - Trees & GraphsMediumAuto-gradedColumn-by-Column Readout of a Level-Order Encoded Tree
Compute the column-wise readout of a binary tree given as a level-order array, ordering nodes by column, then row, then value.
Trees & Graphsbinary-treebfshash-mapsorting - Heaps, Sorting & SearchMediumAuto-gradedValley Finder: Binary Search on an Unsorted Zigzag Array
Find a valley index in an array of adjacent-distinct integers in logarithmic time, using a fixed halving rule that makes the returned index deterministic.
Heaps, Sorting & Searchbinary-searcharraysinvariantsiterative - Dynamic ProgrammingMediumAuto-gradedTallest Staircase Walk Across a Number Board
Find the longest chain of orthogonally adjacent cells with strictly increasing values in a 2D grid, testing DAG longest-path DP, memoization, and avoiding deep recursion.
Dynamic Programmingdynamic-programminggraphdfsmemoization - StringsMediumAuto-gradedLeft-to-Right Calculator Using Only Scalar State
Evaluate a no-parentheses arithmetic string with correct precedence and truncating division in one pass, using only a few scalar variables instead of a stack.
Stringsstring-parsingtwo-pointerssimulationconstant-space - Arrays & HashingMediumAuto-gradedAudit Purchase Events Against a Payment Ledger
Aggregate daily purchase metrics from event logs and reconcile two event snapshots against a ledger to judge whether a tracking fix worked, using hash-map grouping.
Arrays & Hashinghashingaggregationreconciliationdictionaries - Data Structure DesignMediumAuto-gradedPer-Key Cooldown Filter for a Timestamped Event Feed
Walk a time-ordered event feed and decide which events pass a 10-second per-key cooldown, where only accepted events restart the cooldown.
Data Structure Designhash-mapsimulationrate-limitingstreams - Arrays & HashingEasyAuto-gradedMost Frequently Booked Vehicle
Count how many booking records each vehicle has and return the ID with the highest count, breaking ties by the smallest ID.
Arrays & Hashinghash-mapcountingtie-breaking - Arrays & HashingMediumAuto-gradedInner Product of Two Index-Value Lists
Compute the inner product of two sparse vectors given as sorted index-value pairs by intersecting their indices with a linear merge, without building dense arrays.
Arrays & Hashingtwo-pointerssparse-vectorsorted-mergesimulation - Greedy & IntervalsMediumAuto-gradedEarliest Shared Free Slot Across Several Schedules
Find the earliest meeting slot of a given length that fits inside everyone's availability window and avoids every busy block, by intersecting windows and merging busy intervals.
Greedy & Intervalsintervalssweep-linesortingscheduling - Greedy & IntervalsMediumAuto-gradedMerge Event Windows Within Each Locality
Join two record lists by id, group event time ranges by locality, merge overlapping or touching ranges, and return the merged windows in a specified sort order.
Greedy & Intervalsintervalsmerge-intervalshash-mapsorting - Math & Bit ManipulationHardAuto-gradedStreaming Run/Bit-Pack Codec Session Simulator
Simulate a codec session that buffers int32 values, emits run-length and bit-packed blocks on flush, and decodes block lists back to integers.
Math & Bit Manipulationbit-manipulationcompressionsimulationtwos-complement - Data Structure DesignMediumAuto-gradedFunding Ledger with Rail-Specific Settlement and Window Caps
Simulate an ordered account ledger where each payment rail has its own settlement delay, cutoff-shifted window assignment, and per-window cap, and output the combined results.
Data Structure Designsimulationhash-mapheapdesign - Dynamic ProgrammingHardAuto-gradedMinimum Disorder When Interleaving Two Job Queues
Interleave two letter strings while keeping each one's order, minimizing out-of-order pairs; tests 2D prefix DP with O(1) transition costs from alphabet-count tables.
Dynamic Programmingdynamic-programmingstringsprefix-countsinterleaving - Arrays & HashingEasyAuto-gradedScore a Top-k Search Result Against Labeled Files
Clean a noisy ranked result list (missing, duplicated, unknown, or oversized) and compute precision and recall against ground-truth labels.
Arrays & Hashinghashingsetsmetricsinput-validation - Math & Bit ManipulationEasyAuto-gradedDetect a Rate Reversal Between Strata and Pooled Totals
Compare two groups' success rates per stratum and pooled, using exact integer cross-multiplication, to detect when a consistent stratum winner flips in the aggregate.
Math & Bit Manipulationsimulationfractionsaggregationsimpsons-paradox - StringsMediumAuto-gradedFewest Leading Digits Needed to Rearrange Into Each Word
For each query digit string, find the shortest prefix of a digit string containing enough of each digit to form it, using per-digit occurrence lists and a max over digits.
Stringsstringshashingcountingprecomputation - Trees & GraphsMediumAuto-gradedAudit a Workflow Run Against Dependencies and Precedence Rules
Check a run order against a task dependency graph, mandatory tasks and extra precedence pairs, while rejecting duplicates, unknown tasks and cyclic constraints.
Trees & Graphsgraphtopological-sortcycle-detectionhash-map - Arrays & HashingMediumAuto-gradedFirst Long Run of Daily Activity per User
Group activity logs by user, dedupe dates, find maximal consecutive-day runs of length 7 or more, and report each user's earliest such run.
Arrays & Hashinghashingdatesgaps-and-islandssorting - Stacks & QueuesMediumAuto-gradedEager Deletion of Repeated Character Blocks
Scan a string and delete each block of k equal adjacent characters as soon as it forms, handling cascading merges with a run-length stack.
Stacks & Queuesstackstringrun-lengthsimulation - Heaps, Sorting & SearchMediumAuto-gradedResume a Sorted Score Listing from a Last-Seen Key
Filter records by a minimum score, order them by score then id, and return one page after a (score, id) cursor along with the cursor for the following page.
Heaps, Sorting & Searchpaginationsortingtuple-comparisonheap - Stacks & QueuesMediumAuto-gradedEvaluate Nested Prefix Expressions with Scoped Bindings
Parse and evaluate a parenthesized prefix language with sum, prod and set, handling lexical scoping, strict validation and 32-bit overflow rules.
Stacks & Queuesparsingrecursionscopingstack - Data Structure DesignMediumAuto-gradedSubtree Totals Under Collapse and Graft Operations
Maintain per-node totals in a rooted tree while nodes are collapsed into leaves or have a subtree grafted onto a leaf, answering total queries after each change.
Data Structure Designtreehash-mapsimulationparent-pointers