practice a little every day — you've got this ♡
Interview Practice Problems
Practice 5981 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.
- 5981
- Problems
- 2215
- Auto-graded
- 15
- Topics
- 272
- Added today
Showing 241–270 of 2215 results
- Trees & GraphsMediumAuto-gradedCounting Land Clusters on a Wrap-Around Map
Count connected groups of land cells on a grid whose opposite edges wrap around, testing grid traversal with modular adjacency.
Trees & Graphsgraphdfsgridunion-find - Arrays & HashingMediumAuto-gradedSliding Token on a Grid with Timed Heading Changes
Compute a token's final cell on a grid with blocked cells when its heading changes at given timestamps up to 10^9, which requires processing time segments instead of simulating each tick.
Arrays & Hashingsimulationgridintervalslarge-input - Math & Bit ManipulationMediumAuto-gradedGroup Size Threshold and Closest-Pair Gap on a Circle
Compute a birthday-collision threshold exactly and by approximation, plus expected minimum gap and tail probability for random points on a circle, with a Poisson comparison.
Math & Bit Manipulationprobabilitymathbirthday-paradoxpoisson-approximation - Arrays & HashingMediumAuto-gradedSliding Window Maxima on a Grid With Source Positions
Slide a square window over an integer grid with a given step, and report each window's maximum with its grid coordinates, resolving ties by the smallest row, then the smallest column.
Arrays & Hashingmatrixsliding-windowsimulationtie-breaking - Math & Bit ManipulationMediumAuto-gradedExponentiation by Squaring with Negative Exponents
Compute a floating-point base raised to a signed 32-bit integer exponent in logarithmic time, including negative exponents, using repeated squaring.
Math & Bit Manipulationbinary-exponentiationmathbit-manipulationfloating-point - Greedy & IntervalsEasyAuto-gradedConflict-Free Schedule Check for a Single Attendee
Tests sorting intervals and scanning adjacent pairs to detect overlaps under half-open interval rules, where touching endpoints are allowed.
Greedy & Intervalsintervalssortinggreedyarrays - Arrays & HashingEasyAuto-gradedCoupon Usage Caps: Check Remaining Redemptions per User
Count past coupon redemptions per (user, coupon) pair from a log, then answer many read-only queries on whether each user is still under the coupon's cap.
Arrays & Hashinghash-mapcountingaggregationcomposite-key - Math & Bit ManipulationEasyAuto-gradedCard Launch Unit Economics Report Builder
Build a fixed unit-economics report for a card launch: portfolio P&L, partnership uplift, bonus payback time, and the zero-profit loss rate.
Math & Bit Manipulationmathsimulationunit-economicsdictionaries - Trees & GraphsMediumAuto-gradedUnlock Order: Build a Dependency-Respecting Study Plan
Produce a deterministic topological ordering of nodes from prerequisite pairs, or an empty list if a cycle makes it impossible. Tests graph modeling and Kahn's algorithm.
Trees & Graphstopological-sortgraphbfscycle-detection - Data Structure DesignHardAuto-gradedFault-Tolerant Task Dispatcher with Retry Limit and Dependencies
Simulate a job queue where failed jobs retry up to a limit, then go to a dead-letter list, and failures cascade to jobs that depend on them.
Data Structure Designsimulationqueuegraphstate-machine - Arrays & HashingMediumAuto-gradedEarliest-Completing Pair That Hits a Target Sum
Find the pair of indices whose values sum to a target, choosing the pair that finishes earliest in the array, with deterministic duplicate handling, using a one-pass hash map.
Arrays & Hashinghash-maptwo-sumduplicatesone-pass - StringsMediumAuto-gradedFilter Words Expandable to Target String
Determine which words from a dictionary can yield a target string by expanding consecutive duplicate characters in place.
Stringsstringstwo-pointersarrays - Arrays & HashingEasyAuto-gradedMean Household Earnings with Gaps in the Data
Compute the mean of a list of numbers while skipping None and NaN entries, returning 0.0 when nothing valid remains and rounding to two decimals.
Arrays & Hashingarraysdata-cleaningnan-handlingaggregation - SQL & DataMediumAuto-gradedBest-Scoring Enrollee for Each Academic Department
Pick one top student per department from two record lists, using GPA with deterministic tie-breaks, skipping missing values, and keeping departments that have no eligible student.
SQL & Datagroup-wise selectionleft jointie-breakingnull handling - StringsMediumAuto-gradedBracket the Shortest Exclusive Fragment in Every Menu Entry
Find, for each string, its shortest substring that occurs in no other string (case-insensitive), with leftmost tie-break, and wrap it in brackets while keeping original casing.
Stringsstringshash-mapsubstringsbitmask - Math & Bit ManipulationEasyAuto-gradedCalculate Bag Selection Probability via Bayes' Theorem
Given selection priors and ball counts for several containers, calculate the posterior probability of drawing from a specific container after observing a target outcome.
Math & Bit Manipulationmathprobabilitybayes-theoremarrays - Trees & GraphsMediumAuto-gradedGather Unique Items Across a Linked Collection Graph
Run a breadth-first traversal over a directed graph of folders, emitting each item once in first-seen order, while validating every reference and handling cycles.
Trees & Graphsbfsgraphhash-setdeduplication - Arrays & HashingMediumAuto-gradedBucket Words That Share the Same Letters
Partition a list of lowercase words into buckets of mutual rearrangements, using a canonical key and a hash map while keeping a deterministic output order.
Arrays & Hashinghash-mapstringssortinggrouping - Trees & GraphsMediumAuto-gradedLevel-by-Level Site Walk With Failing Pages and a Fetch Cap
Compute a deterministic level-ordered listing of every page reachable from a start page, where failed pages yield no links and concurrency limits must not change the result.
Trees & Graphsbfsgraphlevel-ordersets - Data Structure DesignEasyAuto-gradedSimulate a Task Management Engine with CRUD Operations
Simulate an in-memory task tracker handling creation, retrieval, updates, filtering, and deletion of tasks with valid state validation.
Data Structure Designdesign-dsarraysdata-structuressimulation - SQL & DataMediumAuto-gradedMonthly Line Output Report with Running Totals and Defect Percent
Group daily production records by line and month, add a per-line running total, and compute each month's defect percentage from summed counts.
SQL & Datagroup-byhashingrunning-totalaggregation - Arrays & HashingMediumAuto-gradedEvent Log Selector with Window, Dedupe and Cap
Filter a list of event records by type, time window and id, then order them stably by timestamp and truncate, testing careful handling of optional arguments and ties.
Arrays & Hashinghashingstable-sortfilteringdedupe - Trees & GraphsMediumAuto-gradedFewest Hops from a Start Node While Avoiding Closed Nodes
Run a breadth-first search on a directed or undirected graph, skipping closed nodes, to get each node's minimum edge count from the start, or -1 if it cannot be reached.
Trees & Graphsbfsgraphshortest-pathreachability - Trees & GraphsMediumAuto-gradedIdentify Cycles in Linear Chains and Directed Networks
Detect structural loops in both a next-pointer chain using constant space and a directed graph reachable from a given entry point.
Trees & Graphstrees-graphslinked-listsdfstwo-pointers - Arrays & HashingMediumAuto-gradedCircular Lamps with Traveling Togglers
Find the final bits on a ring after several togglers walk clockwise for k steps, using lap decomposition, parity, and a cyclic difference array.
Arrays & Hashingdifference-arraymodular-arithmeticparitysimulation-optimization - Math & Bit ManipulationEasyAuto-gradedHead Counts in n Fair Coin Tosses: Sequences and Tail Odds
Compute the number of sequences, the chance of exactly 3 heads, and the chance of at most 3 heads for n fair coin tosses, using binomial counting and handling small n.
Math & Bit Manipulationcombinatoricsbinomialprobabilitymath - Arrays & HashingMediumAuto-gradedTriple Challenge: Price Drops, Bounded Windows, Twin Rows
Combine a threshold binary search with greedy arithmetic sums, a linear scan counting subarrays with exact min and max, and hashing of binary rows to count identical pairs.
Arrays & Hashingbinary-searchgreedysliding-windowhashing - Heaps, Sorting & SearchMediumAuto-gradedRead a Value Off a Connected Line-Segment Graph
Evaluate a piecewise linear curve at a query coordinate by locating the right segment with binary search and interpolating, returning None outside the curve's domain.
Heaps, Sorting & Searchbinary-searchinterpolationarraysedge-cases - Data Structure DesignMediumAuto-gradedConditional Form Visibility with Numeric Checks and Nested Groups
Decide which questions of a form are visible by parsing typed answers and evaluating validated, nestable all/any conditions with numeric comparisons.
Data Structure Designparsingvalidationrecursiondecimal - Math & Bit ManipulationMediumAuto-gradedCollapse a Sequence to Ones Using Neighbor GCD Replacements
Find the minimum number of neighbor-GCD replacements to turn an entire array into ones, using shortest coprime-window search and a lower-bound argument.
Math & Bit Manipulationgcdsubarraynumber-theorycase-analysis