practice a little every day — you've got this ♡
Coding Interview Problems
Practice 6040 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.
- 6040
- Problems
- 2237
- Auto-graded
- 15
- Topics
- 275
- Added today
Showing 1201–1230 of 2790 results
- Trees & GraphsMediumAuto-gradedReferral Credit Ledger with Multilevel Propagation
Simulate account additions, referral bonus propagation (direct or indirect), and threshold queries ordered deterministically.
Trees & Graphstrees-graphsarraysdesign-ds - Trees & GraphsMediumAuto-gradedBFS Unweighted Shortest Path with Ancestor Tracking
Perform breadth-first traversal on an unweighted graph to compute shortest distances and record parent pointers for path reconstruction.
Trees & Graphsbfsgraph-traversalshortest-pathqueue - StringsMediumModel answerFix a Buggy Python Table-to-CSV Function
Audit a short Python function that flattens rows into CSV text, list its correctness and performance flaws with triggering inputs, and rewrite it safely and efficiently.
Stringscode-reviewcsvpythonstring-building - Trees & GraphsMediumAuto-gradedLightest Downward Path in a Level-Order Tree
Find the root-to-leaf path with the smallest value sum in a tree given as a level-order list, breaking ties toward the left, without recursion on 100,000-node skewed trees.
Trees & Graphsbinary-treedfsiterative-traversalprefix-sum - Data Structure DesignMediumModel answerBuild a Per-User Throttle and an In-Memory Event Broadcaster
Write a thread-safe per-user token-bucket throttle and a small topic-based event broadcaster that stays correct under concurrency and survives failing listeners.
Data Structure Designrate-limitingtoken-bucketpub-subconcurrency - Heaps, Sorting & SearchMediumAuto-gradedSelect the k Most Common Values with Tie Rules
Count value frequencies and pick the k most frequent values, using a bounded heap and a defined tie-break rule for equal counts.
Heaps, Sorting & Searchheaphash-mapfrequency-countingtop-k - Heaps, Sorting & SearchEasyAuto-gradedAdjacent Entries Lookup in a Sorted Catalog
Answer batched queries on a sorted list of unique IDs by binary searching for each target and returning its adjacent values, or nulls when the target is absent.
Heaps, Sorting & Searchbinary-searchsorted-arraybisectbatch-queries - Heaps, Sorting & SearchEasyAuto-gradedLocate Gap in Sorted Consecutive Sequence
Detect a missing entry in a sorted contiguous array of integers in logarithmic time using binary search.
Heaps, Sorting & Searcharraysbinary-search - Greedy & IntervalsMediumAuto-gradedFind the Maximum Size Connected Interval Component
Find the maximum number of intervals that belong to a single connected component where edges represent inclusive interval overlaps.
Greedy & Intervalsintervalssortinggreedygraphs - Greedy & IntervalsEasyAuto-gradedSplit Chores Between Two Workers With a Fixed Quota
Choose exactly k items for the first worker to maximize total payoff, which tests reducing a problem to per-item differences and greedy top-k selection.
Greedy & Intervalsgreedysortingarraysexchange-argument - Data Structure DesignMediumModel answerSimulate Message Spreading in an Orbital Network
Simulate timed, discrete-event message propagation across a satellite graph and fire report callbacks in exact time and ID order.
Data Structure Designtrees-graphsheaps-sortingdesign-ds - Arrays & HashingEasyAuto-gradedSoftmax-Weighted Value Mixing for Query Rows
Implement scaled dot-product attention on nested lists using a numerically stable softmax and a weighted average of value rows.
Arrays & Hashingmatrixsoftmaxnumerical-stabilityattention - Arrays & HashingEasyAuto-gradedFind the Modal Number, Smallest on a Tie
Tests frequency counting with a hash map and a deterministic numeric tie-break, returning the value itself without altering the input list.
Arrays & Hashinghash-mapcountingtie-breaking - Data Structure DesignMediumModel answerBuild a Bounded, Thread-Safe Resource Pool with Timeouts
Implement a thread-safe pool that lazily creates up to N connections, reuses healthy ones, blocks callers with a deadline when exhausted, and shuts down cleanly.
Data Structure Designconcurrencythread-safetycondition-variableresource-pool - Data Structure DesignMediumAuto-gradedRun a Command Log on a Recency Cache with Live Mean
Simulate a fixed-capacity least-recently-used cache from a command log, answering lookups and the mean of stored values, each in expected constant time.
Data Structure Designlru-cachehash-mapdoubly-linked-listrunning-sum - StringsMediumAuto-gradedEvery Window of Length Three or More Must Be a Known Word
Check that every contiguous substring of length at least 3 appears in a word list, testing set-based lookups, loop bounds and the vacuous case for short strings.
Stringsstringshash-setsubstringsenumeration - Data Structure DesignMediumModel answerConcurrent Least-Recently-Used Cache with Constant-Time Operations
Build a fixed-capacity cache with O(1) lookup, update and eviction by recency, then make it safe for many threads and state exactly what consistency it guarantees.
Data Structure Designlru-cachehash-mapdoubly-linked-listconcurrency - Data Structure DesignMediumAuto-gradedEvaluate Nested Comparison Rules Over a List of Records
Evaluate a nested rule tree of greater-than, less-than, AND and OR nodes against records, keeping matches in order and treating missing or mismatched fields as false.
Data Structure Designrecursiontree-evaluationfilteringvalidation - StringsMediumAuto-gradedCentered Pascal Pyramid Renderer
Build the first n rows of Pascal's triangle and render them as a centered text pyramid with fixed-width, right-aligned cells and floor-based indentation.
Stringspascal-trianglestring-formattingsimulationmath - Trees & GraphsMediumAuto-gradedRead a Tree Off Column by Column from a Level-Order List
Decode a level-order tree list, assign each node a column, and output values grouped by column with row-then-reading-order tie-breaking.
Trees & Graphsbinary-treebfshash-maplevel-order - Trees & GraphsMediumAuto-gradedDepth-Scaled Total of a Nested Integer Structure
Traverse an arbitrarily nested list of integers and add up each value multiplied by how deeply it is nested, testing DFS/BFS traversal of recursive structures.
Trees & Graphsdfsbfsnested-listsrecursion - Arrays & HashingMediumAuto-gradedMerge Sensor Readings into Qualifying State Runs
Group consecutive identical-state readings into runs, then keep only runs whose last-minus-first timestamp span meets a minimum threshold.
Arrays & Hashingrun-lengthsingle-passsimulationgrouping - Data Structure DesignMediumModel answerBuild an In-Memory Hierarchical File System with CRUD Support
Design and implement an in-memory key-value store structured as a file system tree supporting create, set, get, and cascade delete operations with path validation.
Data Structure Designdesign-dstrees-graphsstrings - Data Structure DesignMediumAuto-gradedSimulate a Bounded Recency-Evicting Key-Value Store
Replay a batch of get/put commands against a fixed-capacity store that discards its least recently used key on overflow, with O(1) average cost per command.
Data Structure Designlru-cachehash-maplinked-listsimulation - Data Structure DesignHardModel answerPer-User Rolling Quota Gate with Concurrent Access
Design a thread-safe class that caps how many requests each user may make in any trailing time interval, avoiding the burst problem of fixed windows, with sub-linear cost per check.
Data Structure Designrate-limitersliding-windowdequeconcurrency - Data Structure DesignEasyAuto-gradedBunk Allocation by Preferred Room Size
Match students to rooms by hard size preference in input order, respecting capacity, keeping partially filled rooms, and reporting students who could not be placed.
Data Structure Designqueuessimulationhash-mapgreedy - Dynamic ProgrammingMediumAuto-gradedMaximum Disjoint Triples Summing to 15
Find the most disjoint three-card groups that each sum to 15, using memoized search over value counts because greedy choices can block better groupings.
Dynamic Programmingmemoizationrecursioncombinatoricsstate-compression - Dynamic ProgrammingHardAuto-gradedBest Profit from a Capped Number of Round-Trip Trades
Maximize profit from daily share prices using at most k non-overlapping buy-then-sell trades, testing state-based dynamic programming and handling a trade limit that never binds.
Dynamic Programmingdynamic-programmingarraysstock-tradingstate-machine - Data Structure DesignHardModel answerEscalation Counters and Level Changes in a Review Pipeline
Design a cached repeat-alert counter that triggers rejection of a work order, then extend it so an alert's severity can change without corrupting counts or past decisions.
Data Structure Designcachingidempotencyconcurrencyversioning - Dynamic ProgrammingMediumAuto-gradedMost Populous Digit-Sum Group in a Number Range
Count integers in a huge range grouped by digit sum and return the largest group size, which needs a digit DP with prefix-count subtraction rather than enumeration.
Dynamic Programmingdigit-dpcountingrange-queriesmath