practice a little every day — you've got this ♡
Interview Practice Problems
Practice 6005 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.
- 6005
- Problems
- 2225
- Auto-graded
- 15
- Topics
- 273
- Added today
Showing 631–660 of 2225 results
- Arrays & HashingEasyAuto-gradedCheck Loan Records for Proper Borrow-Return Order
Scan a time-ordered list of library events and verify each item's history strictly alternates borrow, return, starting with a borrow, using per-item state tracking.
Arrays & Hashinghash-setstate-trackingsimulationvalidation - Stacks & QueuesEasyAuto-gradedWell-Formed Bracket Sequence Checker
Decide whether a string of three kinds of brackets is correctly nested, using a stack to enforce that the most recently opened bracket is closed first.
Stacks & Queuesstackstringmatchingparsing - Data Structure DesignMediumAuto-gradedNested Transaction Log for an In-Memory Dictionary
Simulate a key-value store with nested begin, commit and rollback by replaying a command list and recording each read result.
Data Structure Designhash-mapstacktransactionsundo-log - Trees & GraphsMediumAuto-gradedCount Clusters of Linked Playlists from a Match Grid
Count connected components in an undirected graph given as an n x n adjacency matrix, where links chain together transitively.
Trees & Graphsgraphconnected-componentsdfsunion-find - Greedy & IntervalsMediumAuto-gradedBiggest Cabin Party Respecting Everyone's Companion Limits
Find the largest group size k where at least k people accept exactly k-1 companions, using interval counting with a difference array in linear time.
Greedy & Intervalsdifference-arrayintervalscountingprefix-sum - Trees & GraphsMediumAuto-gradedFind the K-th Smallest Element in a BST
Find the k-th smallest key in a binary search tree represented as a level-order array.
Trees & Graphstrees-graphstreesin-order-traversalbinary-search-tree - Arrays & HashingEasyAuto-gradedSmallest Axis-Aligned Box Around Scattered Points
Scan a list of integer 2D points once to find the extreme x and y values, then report the enclosing axis-aligned box as a corner plus width and height.
Arrays & Hashingarraysgeometrymin-maxsingle-pass - Arrays & HashingEasyAuto-gradedCalculate Spend Percentage of High-Volume Spenders
Compute the share of 2023 total expenditure contributed by users who met a high-tier spending threshold in 2022.
Arrays & Hashingarrayshash tabledata manipulationcohort analysis - Arrays & HashingEasyAuto-gradedUncovered Integer Gaps Within a Closed Window
Scan a sorted list of distinct integers once to report every maximal run of integers in a closed window that the list skips, formatting single gaps as one-element lists.
Arrays & Hashingarraysintervalstwo-pointersedge-cases - Heaps, Sorting & SearchHardAuto-gradedNarrowest Window Touching Every Sorted Array
Find the tightest inclusive interval that holds at least one value from each of several sorted arrays, using a k-way merge with a min-heap and a tracked maximum.
Heaps, Sorting & Searchheapk-way-mergesorted-liststwo-pointers - StringsMediumAuto-gradedBracket Depth Scoring of a Nested Integer String
Scan a bracketed string of non-negative integers and sum each integer times its bracket nesting level, handling multi-digit numbers, whitespace and empty lists.
Stringsstring-parsingnested-structuressingle-passbracket-depth - Arrays & HashingMediumAuto-gradedValidate a Shuffled Start/Stop Service Log for Each Component
Replay timestamped start/stop events in time order, with ties broken by input position, tracking one active job per category, and confirm the log is valid and fully closed.
Arrays & Hashinghash-setsortingsimulationstate-tracking - Heaps, Sorting & SearchMediumAuto-gradedLowest K Values in Ascending Order with Duplicates
Select the k smallest values from an unsorted integer list, keeping duplicates and returning them sorted ascending, which tests heap, sorting and selection trade-offs.
Heaps, Sorting & Searchheapsortingselectiontop-k - Heaps, Sorting & SearchMediumAuto-gradedDetermine Available Range on Number Line
Evaluate dynamic range-query operations on 1D coordinates to test whether continuous subsegments contain obstacles.
Heaps, Sorting & Searchheaps-sortingbinary-searchfenwick-treesegment-tree - StringsHardAuto-gradedFewest Neighbor Swaps to Mirror a Word
Compute the minimum number of adjacent character swaps needed to rearrange a lowercase string into a palindrome, or report -1 if no palindrome is possible.
Stringsgreedytwo-pointersstringspalindrome - Heaps, Sorting & SearchMediumAuto-gradedEvaluate a Piecewise Linear Curve From Shuffled Sample Points
Build a piecewise linear function from unordered sample points and evaluate it at one query, extending the end segments outward, using sorting and binary search.
Heaps, Sorting & Searchbinary-searchsortinginterpolationfloating-point - Arrays & HashingMediumAuto-gradedDetect Target Pair in Spiral Matrix Order
Determine if two distinct cells in a 2D matrix sum to a target integer while processing elements in spiral order.
Arrays & Hashingarrayshash-tablematrix - Dynamic ProgrammingHardAuto-gradedTrim Letters to Reach a Mirror String Within a Budget
Decide whether a string can become a palindrome after removing no more than k characters, testing interval dynamic programming and palindromic subsequence reasoning.
Dynamic Programmingdynamic-programmingpalindromestringssubsequence - Dynamic ProgrammingMediumAuto-gradedCount Step Sequences with Custom Prime Jumps
Find the number of unique sequences of steps to reach a target using 1-unit steps or prime steps ending in digit 3.
Dynamic Programmingdynamic-programmingmathsievemodular-arithmetic - Trees & GraphsMediumAuto-gradedTrace a Phrase Through Neighboring Tiles
Decide whether a string can be traced through a rectangular letter grid by stepping to up/down/left/right neighbors without reusing a cell, using backtracking search.
Trees & Graphsbacktrackingdfsmatrixpruning - Trees & GraphsMediumAuto-gradedDeepest Shared Ancestor of Two Nodes in a Rooted Tree
Find the deepest node whose subtree contains two given nodes in a tree stored as child lists, using a single depth-first pass that stays safe on very deep trees.
Trees & Graphstreedfslowest-common-ancestorpost-order - SQL & DataMediumAuto-gradedDaily SHOP vs WEBSITE Revenue Mix and Efficiency Report
Aggregate two event tables over a 30-day window, fill missing rows with zeros, and compute safe-division shares and revenue-per-conversion per day and destination.
SQL & Dataaggregationhash-mapdate-windowdata-manipulation - Data Structure DesignMediumAuto-gradedReplay a Typing Session Against a Ranked Suggestion History
Simulate keystroke-by-keystroke search suggestions over a frequency-weighted history that grows as queries are committed, ranking the top 3 matches by count and then text.
Data Structure Designhash-mapdesignstring-prefixtop-k - Trees & GraphsMediumAuto-gradedCheapest Transit Pick on a Lettered Street Grid
Run a per-mode BFS on a grid to find step counts, then choose the mode with least total time, then least total cost, then smallest index.
Trees & Graphsbfsgridshortest-pathtie-breaking - Greedy & IntervalsMediumAuto-gradedEven Budget Split Under Per-Person Caps
Split a budget as evenly as possible among people with individual caps, using a binary-searched fill level plus a lowest-index-first remainder rule.
Greedy & Intervalsgreedybinary-searchwater-fillingarrays - StringsEasyAuto-gradedMatch Words to a Keypad Number Sequence
Given a word list and a string of keypad digits, return the sorted words whose letters map to exactly that digit sequence, testing string encoding and filtering.
Stringsstringshashingsortingsimulation - Arrays & HashingMediumAuto-gradedCount Disjoint Pairs That Add Up to a Goal Value
Find the most disjoint pairs in an integer list whose sum equals a goal, using value counts or sorting with two pointers, while handling duplicates, negatives and the half-goal case.
Arrays & Hashinghash-maptwo-pointersgreedycounting - Heaps, Sorting & SearchMediumAuto-gradedLocate the K-th Dominant Value
Find the k-th largest integer in an unsorted list efficiently using quickselect or priority queues.
Heaps, Sorting & Searchheaps-sortingarraysquickselect - Heaps, Sorting & SearchMediumAuto-gradedFind Unique Combination Triples for Target Sum
Find all distinct non-decreasing 3-element value combinations in an array that add up to a specified target value.
Heaps, Sorting & Searcharrayssortingtwo-pointers - 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