practice a little every day — you've got this ♡
Interview Practice Problems
Practice 6008 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.
- 6008
- Problems
- 2226
- Auto-graded
- 15
- Topics
- 273
- Added today
Showing 661–690 of 2226 results
- Stacks & QueuesMediumAuto-gradedValidate Deep Structure Equivalence
Recursively or iteratively check if two arbitrarily nested data structures are identical in type, shape, and value.
Stacks & Queuesrecursionstackdata-structureshashing - Dynamic ProgrammingMediumAuto-gradedPair Workers With Distinct Stations at Minimum Grid Distance
Match each point in one list to a different point in a larger list so the total Manhattan distance is minimal, which suits a bitmask DP given the small limits.
Dynamic Programmingbitmask-dpassignment-problemmanhattan-distance - Arrays & HashingMediumAuto-gradedCount Maximum Disjoint Pairs Summing to a Target
Find the most index-disjoint pairs in an integer array whose values add up to a target, testing hashing of complements, counting, and handling of the self-pairing case.
Arrays & Hashinghash-mapcountingtwo-pointersgreedy - Stacks & QueuesEasyAuto-gradedCancel Neighboring Letter Pairs in a String
Tests using a stack to repeatedly cancel adjacent equal characters in a string, including cascading cancellations, in linear time.
Stacks & Queuesstackstringsimulation - Stacks & QueuesMediumAuto-gradedPer-Function Self Time from a Call Trace
Sweep a single-threaded call trace with a stack to total each function's self time under half-open intervals, with recursion, strict validation, and name-sorted output.
Stacks & Queuesstacksimulationhash-mapvalidation - StringsEasyAuto-gradedEarliest Non-Repeating Symbol Position
Locate the index of the earliest symbol in an alphanumeric string that occurs only once, using frequency counting and an ordered scan, or return -1.
Stringshash-mapcountingstringtwo-pass - Heaps, Sorting & SearchMediumAuto-gradedSimulate Multi-Timer Expiry with Single System Timer
Simulate the execution and triggering order of multiple scheduled timers using a min-heap under system clock advancements.
Heaps, Sorting & Searchheappriority-queuedesignsimulation - Trees & GraphsMediumAuto-gradedDetermine Build Task Schedule
Find a valid topological sequence for tasks with prerequisite constraints or detect cyclic dependencies.
Trees & Graphsgraphtopological-sortbfsdfs - StringsEasyAuto-gradedRun Strings Through a Two-Letter State Machine
Simulate a partial deterministic automaton over the letters a and b, handling missing transitions, invalid symbols and empty input, and report acceptance for a batch of query strings.
Stringssimulationhash-mapstate-machinestrings - Dynamic ProgrammingMediumAuto-gradedSmallest Fully Bracketed Arithmetic Expression Hitting a Target
Enumerate all operator and bracket choices over an ordered list of numbers and return the ASCII-smallest canonical expression that evaluates to the target, or an empty string.
Dynamic Programmingrecursioninterval-dpexpression-treesmemoization - Data Structure DesignMediumAuto-gradedDesign an In-Memory Reservation Manager
Implement an in-memory venue reservation system supporting quick seat allocation, cancellation tracking, and capacity queries.
Data Structure Designhash-tabledesignstacksdata-structures - Math & Bit ManipulationEasyAuto-gradedFive Quick Quantitative Puzzles with Exact String Answers
Solve five short arithmetic and algebra puzzles (units, compounding percentages, linear system, rate, series scaling) and return them in an exact string format.
Math & Bit Manipulationmatharithmeticalgebraunit-conversion - StringsMediumAuto-gradedLongest Window Where Every Letter Meets a Minimum Count
Find the longest contiguous substring in which every letter that appears occurs at least k times, using a sliding window or divide and conquer.
Stringssliding-windowstringshash-mapdivide-and-conquer - Math & Bit ManipulationMediumAuto-gradedApproximate a Square Root to the Nearest Tenth
Compute the square root of a non-negative number without a built-in root function and return it rounded to one decimal place, using bisection or Newton's method.
Math & Bit Manipulationbinary-searchnumerical-methodsfloating-pointmath - Math & Bit ManipulationEasyAuto-gradedPossible Subspace Intersection Dimensions
Computes all valid integer dimensions for the intersection of two vector subspaces given ambient and subspace dimensions.
Math & Bit Manipulationmathlinear-algebra - Arrays & HashingMediumAuto-gradedClosest Bakery Stall for Every Shopper on a Street
For each shopper on a line, find the closest stall index, with ties going to the lower index, testing two-sided linear scans for nearest-neighbor lookups.
Arrays & Hashingarraystwo-pointersprefix-suffixnearest-neighbor - Math & Bit ManipulationMediumAuto-gradedFirewall Rule Resolver with Longest-Prefix Priority
Resolve an IPv4 address against CIDR allow/deny rules using longest-prefix precedence, later-rule tie-breaking, and a default of deny, via bitmask matching.
Math & Bit Manipulationbit-manipulationcidripv4simulation - Dynamic ProgrammingHardAuto-gradedVisit Every Node Exactly Once: Path Existence in a Small Graph
Decide whether an undirected graph of at most 20 vertices has a simple path through every vertex, which is best solved with a bitmask DP over visited subsets.
Dynamic Programmingbitmask-dpgraphhamiltonian-pathsubsets - Math & Bit ManipulationMediumAuto-gradedEnumerate Every Factor of a Large Integer in Sorted Order
Produce all positive factors of an integer up to 10^12 in increasing order, handling perfect squares and large primes, and consider approaches faster than a square-root scan.
Math & Bit Manipulationnumber-theorydivisorsfactorizationsquare-root - Heaps, Sorting & SearchMediumAuto-gradedLowest-Sum Pairs Across Two Sorted Lists
Select the k cheapest cross-array pairs from two sorted lists using a heap-based k-way merge, with a deterministic ordering for ties.
Heaps, Sorting & Searchheapk-way mergesorted arrayspriority queue - Trees & GraphsMediumAuto-gradedTree Span and Grid Escape: Two Graph Queries in One Call
Compute a tree's longest path in edges and the shortest 4-directional route through a grid with obstacles, returning both results together.
Trees & Graphsbfstree-diametershortest-pathgrid - Data Structure DesignMediumAuto-gradedChat Activity Tracker with a Rolling 15-Minute Window
Simulate a chat activity tracker with a closed rolling window, touch/close liveness rules, and out-of-order events, using bounded-memory eviction.
Data Structure Designdesignhash-mapheapsliding-window - Stacks & QueuesEasyAuto-gradedCollapse Repeated Letters: Pair Cancel or Full Run Wipe
Simulate cascading deletions of equal neighbouring letters with a stack, either cancelling pairs or erasing whole leftmost runs, and return what is left.
Stacks & Queuesstackstringsimulationrun-length - Arrays & HashingMediumAuto-gradedCount Index Pairs With a Fixed Value Gap
Count index pairs i < j whose values differ by exactly k, using a frequency map and handling the k = 0 case separately to avoid double counting.
Arrays & Hashinghash-mapcountingfrequencypairs - Heaps, Sorting & SearchMediumAuto-gradedBudget Growth Through Threshold-Locked Ventures
Greedy plus min-sorted unlocking and a max-heap: pick up to k ventures, each requiring a minimum budget, to maximize the final budget.
Heaps, Sorting & Searchgreedyheapsortingpriority-queue - Trees & GraphsMediumAuto-gradedCount Islands of Mutual Acquaintances in a Matrix
Count connected components in an undirected graph given as a symmetric adjacency matrix, without modifying the input, using graph traversal or union-find.
Trees & Graphsgraphconnected-componentsdfsunion-find - StringsMediumAuto-gradedLongest Stretch of Non-Repeating Characters
Find the length of the longest contiguous run in a string where every character is distinct, using a linear-time sliding window with index tracking.
Stringssliding-windowhash-maptwo-pointersstrings - Heaps, Sorting & SearchMediumAuto-gradedLocate the Span of a Value in a Sorted List
Use binary search to find the first and last positions of a value in a sorted list with duplicates, in logarithmic time, returning [-1, -1] if it is absent.
Heaps, Sorting & Searchbinary-searcharraysbisectsorted-array - Arrays & HashingMediumAuto-gradedCollapse Rapid Cart Adds into Daily Pacific Action Counts
Filter add-to-cart events, convert UTC to Pacific dates, merge rapid repeats into single actions with a chained gap rule, and count the actions per user, date and SKU.
Arrays & Hashinghashinggroupingdatetimetimezones - Data Structure DesignMediumAuto-gradedDesign a Dispatch Queue for Autonomous Taxi Requests
Simulate an event-driven dispatching system that maintains pending requests ordered by pickup time and processes state updates efficiently using heaps and hash maps.
Data Structure Designheaphash-tabledesignsorting