practice a little every day — you've got this ♡
Interview Practice Problems
Practice 5978 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.
- 5978
- Problems
- 2214
- Auto-graded
- 15
- Topics
- 272
- Added today
Showing 181–210 of 2214 results
- 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 & IntervalsMediumAuto-gradedEstimate Percentile from Histogram Buckets
Linearly interpolate a percentile value across histogram buckets assuming uniform distribution within each interval.
Greedy & Intervalsmathintervalshistogrampercentile - 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 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 - Data Structure DesignMediumAuto-gradedLive Complement Counting with Point Updates on One Array
Answer repeated target-sum pair-count queries over two integer arrays while the second array receives point updates, using frequency maps.
Data Structure Designhash-mapfrequency-countcounting-pairssimulation - Data Structure DesignMediumAuto-gradedRanked Staff Roster Across Multiple Forums with Swap-Down
Simulate a batch of operations on per-forum ordered staff lists, enforcing seniority rules for adding, moving down one place, and removing members.
Data Structure Designdesignhash-mapsimulationordered-list - Trees & GraphsMediumAuto-gradedSort a List and Replay Commands on a Binary Search Tree
Sort an integer list without built-in sorting, then run a script of insert, search, delete and in-order commands on a duplicate-free binary search tree built from scratch.
Trees & Graphsbinary-search-treequicksortrecursiontree-deletion - Arrays & HashingMediumAuto-gradedKeep Words Whose Letter Multiset Appears More Than Once
Filter a word list to the entries whose letter multiset is shared by at least two entries, keeping input order and duplicates, using letter-count keys.
Arrays & Hashinghash-mapanagramscountingstrings - Arrays & HashingEasyAuto-gradedLeaked Allocations: Filter Blocks Missing From Live Pointers
Filter a list of allocated block addresses to those absent from a list of live pointers, keeping the original order, using hash-set membership for linear-time performance.
Arrays & Hashinghash-setfilteringorder-preservationarrays - Trees & GraphsMediumAuto-gradedSplit Nodes Into Two Groups With No Internal Links
Decide whether the vertices of an undirected multigraph can be split into two groups so every edge crosses between them, handling self-loops, repeated edges, and isolated nodes.
Trees & Graphsgraphbfsbipartiteconnected-components - Math & Bit ManipulationMediumAuto-gradedInteger Power via Repeated Squaring
Compute a float raised to a signed 32-bit integer power in logarithmic time and constant space, handling negative exponents, zero bases and the most negative exponent.
Math & Bit Manipulationbinary-exponentiationfloating-pointedge-casesiteration - Math & Bit ManipulationEasyAuto-gradedLocate the Prime at a Given Position in the Prime Sequence
Find the prime at a given 1-based position in ascending order, which tests sieving, bounding the search range, and complexity reasoning.
Math & Bit Manipulationprimessievenumber-theorymath - Arrays & HashingEasyAuto-gradedEnumerate Every Settings Grid from Option Lists
Build the Cartesian product of named option lists into a list of dictionaries, handling empty inputs and a defined output order.
Arrays & Hashingcartesian-productbacktrackingitertoolsdictionaries - Math & Bit ManipulationMediumAuto-gradedEvaluate a Normalized CDF from Piecewise-Linear Density Samples
Build a cumulative distribution from sampled density points using exact integration of a piecewise-linear curve, then answer many query points with correct boundary behavior.
Math & Bit Manipulationnumerical-integrationbinary-searchprefix-sumsprobability - Data Structure DesignMediumAuto-gradedFlag Rule Resolver with Hash-Bucketed Rollouts
Simulate a feature-flag service: match attribute rules, gate by a SHA-256 percentage bucket, and resolve conflicts so any matching "on" rule wins.
Data Structure Designsimulationhashingrules-enginedesign - Arrays & HashingMediumAuto-gradedTally Orders per Customer by Status Column
Group order records by customer and count how many fall into each requested status, producing one sorted, zero-filled row per customer.
Arrays & Hashinghash-mapgroupingcountingsorting - Stacks & QueuesMediumAuto-gradedFour-Function Calculator Without Parentheses
Evaluate a string of non-negative integers with +, -, *, / and spaces, honoring precedence and truncating division toward zero, without using eval.
Stacks & Queuesstring-parsingstackoperator-precedencesimulation - Trees & GraphsMediumAuto-gradedFastest Signal Arrival Times Across a Relay Grid
Compute shortest-path distances from one source in an undirected graph with non-negative weights, handling parallel edges, self-loops, and unreachable nodes.
Trees & Graphsdijkstrashortest-pathgraphheap - Arrays & HashingMediumAuto-gradedRichest Window of Stalls Under Count and Distance Limits
Find the best sum over a contiguous run of position-sorted items, limited by item count and coordinate span, using sorting and a two-pointer sweep.
Arrays & Hashingsliding-windowtwo-pointerssortingprefix-sums - Trees & GraphsHardAuto-gradedDistinct Transitive Prerequisites in a Dependency DAG
For each node in a DAG whose links may name unknown items, count the distinct nodes reachable along link direction, counting shared descendants once.
Trees & Graphsgraphdagtopological-sortbitset - Trees & GraphsMediumAuto-gradedDoes This One-Way Network Contain a Loop?
Decide whether a directed graph given as an adjacency list contains a cycle, handling self-loops, parallel edges, disconnected parts and an empty graph.
Trees & Graphsgraphdirected-graphcycle-detectiontopological-sort - Heaps, Sorting & SearchMediumAuto-gradedFind Earliest Compatible Release Version
Find the smallest semantic version that satisfies a monotonic compatibility check while minimizing evaluations.
Heaps, Sorting & Searchbinary-searchsortingarrays - Heaps, Sorting & SearchMediumAuto-gradedMost Frequent Ads Within a Closed Time Range
Select the K most frequent ad IDs among timestamped impressions in an inclusive window, breaking ties by smaller ID; tests binary search on sorted data plus counting and ordering.
Heaps, Sorting & Searchbinary-searchhash-mapsortingsliding-window