practice a little every day — you've got this ♡
Coding Interview Problems
Practice 5980 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.
- 5980
- Problems
- 2215
- Auto-graded
- 15
- Topics
- 272
- Added today
Showing 211–240 of 2765 results
- Dynamic ProgrammingMediumAuto-gradedBest Final Score from Affine Card Purchases Under a Budget
Choose a budget-limited subset of cards and an order to maximize a score updated by an affine rule, testing subset and ordering search and exchange-argument reasoning.
Dynamic Programmingsubset-searchpermutationsexchange-argumentknapsack - Trees & GraphsMediumModel answerIdentify Node Value Present Across Most Depth Levels
Find the binary tree node value that appears across the highest number of unique depth levels.
Trees & Graphstrees-graphsbreadth-first-searchhash-table - Heaps, Sorting & SearchMediumAuto-gradedTruncate and Renormalize a Next-Token Distribution
Sort a probability list with deterministic tie-breaking, then build two truncated, renormalized versions: fixed-size top-k and cumulative-mass top-p.
Heaps, Sorting & Searchsortingprefix-sumprobabilityfloating-point - Heaps, Sorting & SearchMediumAuto-gradedLocate a Value in a Cyclically Shifted Ascending List
Search a cyclically shifted strictly increasing list of distinct integers for a value in O(log n), returning its index or -1, including unshifted and single-element cases.
Heaps, Sorting & Searchbinary-searcharraysrotated-arraydivide-and-conquer - Stacks & QueuesMediumAuto-gradedInfer Execution Events from Call Stack Snapshots
Reconstruct chronological function START and END lifecycle events by evaluating structural differences across consecutive call stack snapshots.
Stacks & Queuesstacks-queuesarraysstrings - Arrays & HashingEasyAuto-gradedGroup Identical Files by Content from an In-Memory Listing
Group file entries that have identical byte content, using content length as a cheap first filter, and return only groups of two or more paths in a specified order.
Arrays & Hashinghashinggroupingstringssimulation - Arrays & HashingMediumAuto-gradedTally Contiguous Segments Matching a Goal Total
Count contiguous non-empty segments of an integer array whose sum equals a goal, using running totals and a frequency map to handle negatives and zeros in linear time.
Arrays & Hashingprefix-sumhash-mapsubarraycounting - Greedy & IntervalsMediumAuto-gradedMax Gains from Single and Multi-Trade Asset Strategies
Calculate maximum achievable gain for an asset sequence under single-trade and unlimited-trade restrictions.
Greedy & Intervalsarraysgreedydynamic-programming - Math & Bit ManipulationEasyAuto-gradedSpread of a Number List: Population Variance
Implement population variance on a list of numbers without external libraries, handling empty and single-element inputs and choosing a numerically sound approach.
Math & Bit Manipulationvariancestatisticsfloating-pointarrays - Trees & GraphsEasyAuto-gradedDistance Map to the Closest Exit in a Maze Grid
Compute, for every cell of a grid with walls and exits, the fewest steps to the nearest exit, marking walls and cut-off cells as -1, using multi-source BFS.
Trees & Graphsbfsgridmulti-source-bfsshortest-path - Arrays & HashingEasyAuto-gradedSimulate Key-Value Operations
Process a series of insertion, update, and deletion instructions on a key-value store and return the final contents ordered by key.
Arrays & Hashingarraysstringshash-table - Heaps, Sorting & SearchMediumAuto-gradedStable Divide-and-Conquer Sort of an Integer List
Sort a list of integers in ascending order without mutating the input, using a divide-and-conquer merge approach that guarantees O(n log n) time and linear auxiliary space.
Heaps, Sorting & Searchsortingdivide-and-conquermerge-sortstability - Heaps, Sorting & SearchMediumAuto-gradedRank Selection Plus Longest Leave-Assisted Break
Combines selecting the element at a 0-indexed rank in descending order with a sliding window finding the longest stretch containing at most a given number of workdays.
Heaps, Sorting & Searchheapsliding-windowtwo-pointersorder-statistics - Heaps, Sorting & SearchMediumAuto-gradedIdentify Unique Zero-Sum Triples
Find all distinct combinations of three elements in an integer sequence that sum to zero using two pointers and duplicate handling.
Heaps, Sorting & Searcharraystwo-pointerssorting - StringsMediumAuto-gradedWords Spelled by a Finger Trace Across Keys
Find all dictionary words that fit a key trace as a start- and end-anchored subsequence where letters may reuse a key, using a next-occurrence table to match many words efficiently.
Stringsstringssubsequencegreedyprecomputation - Trees & GraphsHardModel answerRegion-Splitting Tree and Multi-Word Grid Search
Compress a square character grid into a four-way region tree, then locate a batch of words in the grid by walking neighbors in eight directions without reusing cells.
Trees & Graphsquadtreetriebacktrackingdivide-and-conquer - StringsMediumAuto-gradedResolve Nested %NAME% Placeholders with Cycle Detection
Expand %NAME% placeholders whose values may reference other placeholders, handling %% escapes, missing names, and circular references.
Stringsparsingdfsmemoizationcycle-detection - Dynamic ProgrammingMediumAuto-gradedCounting Sorted Sequences With Prescribed Digit Sums
Count non-decreasing sequences of integers in [0, 5000] whose i-th element has a given digit sum, using DP over candidate values with prefix sums, modulo 1,000,000,007.
Dynamic Programmingdynamic-programmingprefix-sumstwo-pointerscounting - Greedy & IntervalsMediumModel answerStaffing Timeline from Overlapping Work Shifts
Turn a list of overlapping employee shifts into contiguous time segments, each listing who is on duty, with empty segments marking gaps in coverage.
Greedy & Intervalssweep-lineintervalshash-mapsorting - Greedy & IntervalsMediumAuto-gradedEstimate Percentile from Histogram Buckets
Linearly interpolate a percentile value across histogram buckets assuming uniform distribution within each interval.
Greedy & Intervalsmathintervalshistogrampercentile - StringsMediumModel answerString Internals, Move Costs, and Threads vs Async Tasks
Describe how a string is laid out in memory, what copying and moving really cost, what a Rust move does, and how OS threads differ from async coroutines.
Stringsstringsmemory-managementmove-semanticsrust - Data Structure DesignMediumAuto-gradedReplay a Sequence of Recency-Evicting Cache Commands
Simulate a fixed-capacity cache that evicts the least recently used entry, replaying a list of get/put commands and returning each command's result.
Data Structure Designlru-cachehash-maplinked-listsimulation - Dynamic ProgrammingHardAuto-gradedFewest Cabinets for Two-Resource Jobs
Group jobs with two resource demands into the fewest identical cabinets, using exact search with symmetry breaking and pruning (2D vector bin packing).
Dynamic Programmingbin-packingbacktrackingbitmaskcombinatorial-optimization - Math & Bit ManipulationMediumAuto-gradedSmallest Palindrome Above a Given Number
Find the smallest palindromic integer strictly larger than a non-negative integer, using the left half of the digits and carry handling, including the all-9s case.
Math & Bit Manipulationpalindromedigitsmathcarry - Greedy & IntervalsMediumAuto-gradedSentinels on a Road: Best Covered Value With Single Left Steps
Maximize the total value of covered towns on a line when each sentinel may step one town left at most once into an empty town, by finding which town each run of sentinels leaves uncovered.
Greedy & Intervalsgreedystringsarrayssegments - Math & Bit ManipulationEasyAuto-gradedTotal of Numbers Sharing a Factor of 3, 5, or 7
Compute the sum of integers from 1 to n divisible by at least one of 3, 5, or 7, counting each integer once, which tests overlap handling and inclusive bounds.
Math & Bit Manipulationmathinclusion-exclusioniterationdivisibility - Arrays & HashingMediumAuto-gradedClosest Response Times: List the Tightest Increasing Pairs
Find the smallest absolute gap between any two readings, then list every strictly increasing pair achieving it, handling duplicates correctly. Tests sorting and adjacent-gap reasoning.
Arrays & Hashingsortingarraysadjacent-differenceedge-cases - Data Structure DesignMediumModel answerUpgrade a Streaming Log Filter to Multi-Code and JSON Output
Refactor a small Python log-counting script so it filters on several status codes, optionally writes JSON, streams multi-gigabyte files in constant memory, and stays unit-testable.
Data Structure Designpythonrefactoringstreamingcli - Data Structure DesignMediumAuto-gradedBatch Simulator for a TTL-Aware Name Lookup Service with Aliases
Simulate a batch of record insertions and lookups with normalized names, TTL expiry, alias-chain following, cycle and hop-limit detection, and A/alias exclusivity.
Data Structure Designhash-mapsimulationdesignstring-normalization - Trees & GraphsMediumAuto-gradedFastest Route Time Through a One-Way Street Network
Find the minimum total cost between two nodes of a directed graph with non-negative edge weights, returning -1 if no route exists. Tests shortest-path reasoning with a priority queue.
Trees & Graphsdijkstrashortest-pathgraphheap