practice a little every day — you've got this ♡
Interview Practice Problems
Practice 5974 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.
- 5974
- Problems
- 2212
- Auto-graded
- 15
- Topics
- 269
- Added today
Showing 151–180 of 2212 results
- Greedy & IntervalsMediumAuto-gradedMax Speed Continuous Window on Ticked Rate Stream
Find the maximum average throughput over a continuous time window of a specified size, given rate logs over uniform time ticks.
Greedy & Intervalssliding-windowtwo-pointersgreedyprefix-sum - Arrays & HashingEasyAuto-gradedWord-Count Cosine Score for Two Text Strings
Compute the cosine of the angle between the word-frequency vectors of two strings, using a hash-map counter and guarding against empty inputs.
Arrays & Hashinghash-mapcountingstringsmath - Arrays & HashingMediumAuto-gradedCount Squares Spanned by Crossing Vertical and Horizontal Segments
Count axis-aligned squares whose four corners all lie where a vertical segment meets a horizontal one, using per-row bitmasks and pairwise row comparison.
Arrays & Hashinggeometrybitmaskhashingenumeration - Data Structure DesignMediumAuto-gradedLog Record Dedup: Batch Merge and Watermarked Replay
Deduplicate log records by event id under a first or latest policy, then replay an operation list through a watermark-based stream deduplicator that drops late data and evicts finalized entries.
Data Structure Designhash-mapsortingstreamingwatermark - Trees & GraphsMediumAuto-gradedIndented Staff Listing from Direct-Report Pairs
Build a forest from (employee, manager) pairs and output each person with their depth in a sorted depth-first order, handling very deep chains iteratively.
Trees & Graphstreedfsforesthash-map - Trees & GraphsMediumAuto-gradedSplit a Nested Structure into Values and a Shape Template
Implement a single function that extracts leaves and a shape template from nested lists and dicts, then rebuilds the original from them, testing recursion and traversal order.
Trees & Graphsrecursiondfsnested-structuresdictionaries - Data Structure DesignHardAuto-gradedCredit Ledger Simulator with Merges and Delayed Rewards
Simulate a timestamped ledger with deposits, transfers, spends with delayed cashback, account merges and spend rankings, using union-find and a min-heap.
Data Structure Designdesignunion-findheapsimulation - Arrays & HashingMediumAuto-gradedCheck Whether Two Custom Dice Give a Flat Sum Distribution
Decide whether two lists of die-face labels make every total from 1 to 12 appear exactly three times across all 36 face pairings, using pair counting.
Arrays & Hashingcountinghash-mapenumerationprobability - Math & Bit ManipulationMediumAuto-gradedGrowing Worker Pool Sized by Peak Load Readings
Track a pool that only grows, sized to cover each load reading with fixed-capacity workers; tests ceiling division and running-maximum reasoning with large values.
Math & Bit Manipulationsimulationprefix-maximumceiling-divisionarrays - Data Structure DesignMediumAuto-gradedExpiring Key-Value Store Driven by a Virtual Clock
Simulate a key-value store with per-key expiry on a manual clock, handling overwrites, deletes and cleanup of expired entries via a command list.
Data Structure Designdesignhash-mapheapttl - Heaps, Sorting & SearchMediumAuto-gradedLargest Threshold Met by Daily Step Counts
Find the largest integer k such that at least k entries in a list are at least k, testing sorting or counting-based selection and reasoning about monotone thresholds.
Heaps, Sorting & Searchsortingcountingh-indexarrays - Dynamic ProgrammingHardAuto-gradedAdaptive Word Guessing Minimax Strategy
Find the minimum number of worst-case letter guesses required to isolate a hidden word against an adversarial host.
Dynamic Programmingdynamic-programmingbit-manipulationminimaxmemoization - Greedy & IntervalsMediumAuto-gradedPeak Crew Size for Scheduled Shifts
Compute the smallest crew that covers every scheduled task by finding the peak simultaneous demand, treating each task as half-open and parsing HH:MM times.
Greedy & Intervalssweep-lineintervalsgreedysorting - 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 - 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 - SQL & DataMediumAuto-gradedRetail Reports: Product Revenue Stats and Regional Customer Ranks
Emulate SQL-style reporting in Python: grouped mean and population stddev, NULL-to-zero mapping, inner joins across three tables, and RANK/DENSE_RANK within partitions.
SQL & Datasqlgroup-byjoinswindow-functions - 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 - 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