practice a little every day — you've got this ♡
Coding Interview Problems
Practice 6041 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.
- 6041
- Problems
- 2237
- Auto-graded
- 15
- Topics
- 275
- Added today
Showing 1231–1260 of 2790 results
- Trees & GraphsMediumAuto-gradedCheapest Edit Count to Turn a Tree into a Perfect Tree
Find the minimum number of leaf deletions and node insertions that make a binary tree perfect, using per-level counts and a bounded search over the target height.
Trees & Graphsbinary-treebfslevel-ordermath - Trees & GraphsMediumAuto-gradedRecover the Preorder of a BST from Its Postorder Listing
Turn the postorder listing of a distinct-valued BST into its preorder listing in linear time, including chain-shaped trees, using a monotonic stack over the reversed input.
Trees & Graphsbinary-search-treemonotonic-stacktree-traversalreconstruction - Math & Bit ManipulationEasyModel answerTimed Reasoning Quiz: Sequences, Cycles and Grammar Gaps
Answer three short reasoning items (number sequence, repeating symbols, sentence completion) and explain a time-boxed strategy for a 50-item, 15-minute screen with no wrong-answer penalty.
Math & Bit Manipulationaptitudepattern-recognitionmodular-arithmetictime-management - Trees & GraphsMediumModel answerTraverse a Concurrent Dependency Graph with Rate Control and Retries
Discover the full transitive dependency graph of a package using sequential BFS and concurrent worker pools with retry handling and exact termination logic.
Trees & Graphstrees-graphsdesign-dsstacks-queuesconcurrency - Arrays & HashingMediumAuto-gradedWidest Window With an Exact Total in a Signed Sequence
Find the longest contiguous run in an integer list (negatives and zeros allowed) whose total equals a target, using prefix sums and a hash map of earliest positions.
Arrays & Hashingprefix-sumhash-mapsubarray - StringsMediumAuto-gradedEven-Width Paragraph Formatter
Greedily pack words into lines of a fixed width, then pad each line with spaces so it is exactly that wide, handling single-word and final lines separately.
Stringsstringsgreedysimulationtext-justification - Math & Bit ManipulationMediumAuto-gradedCalculate Promotion Break-Even for Rental Discount
Compute the break-even target for new customer acquisitions under base and spend-uplift promotional scenarios.
Math & Bit Manipulationmathunit-economicsfinancial-modeling - StringsMediumAuto-gradedCheck Whether a Token Is a Well-Formed Decimal Literal
Scan a string once to decide if it matches a small decimal-literal grammar with optional sign, a dotted mantissa and an optional exponent, handling many edge cases.
Stringsstring-parsingstate-machinevalidationedge-cases - Heaps, Sorting & SearchEasyAuto-gradedRank Top Earners Worldwide After Converting to USD
Merge several lists of employee records, convert each salary to USD using a rate map, and return the top N earners with a deterministic tie-break.
Heaps, Sorting & Searchsortinghash-mapdata-manipulationsimulation - Trees & GraphsMediumAuto-gradedReachable Vaults and Weighted Bracket Nesting Score
Combine graph reachability from a start node with computing a nesting-weighted score of a balanced bracket string, returning both results as a pair.
Trees & Graphsgraph-traversaldfsstringsparentheses - Data Structure DesignMediumModel answerDesign an Extensible Boolean Rule Evaluation Engine
Construct an object-oriented expression tree for logical and comparison operations that evaluates safely against context dictionaries with short-circuiting.
Data Structure Designobject-oriented-designtreecomposite-patternevaluation-engine - Arrays & HashingHardAuto-gradedReachable Smallest Missing Values After a Single Increment
Find every possible smallest-missing value of an array after at most one capped +1 edit, using counting and MEX case analysis in linear time.
Arrays & Hashingmexcountingcase-analysisfrequency-array - Linked ListsMediumModel answerUnlink From the Tail and Prune a Tree by Leaf Swap
Two pointer-manipulation tasks: remove the k-th node from the tail of a singly linked list, and delete a value from a general binary tree by overwriting it with the deepest-rightmost node's value.
Linked Listslinked-listtwo-pointersbinary-treebfs - Math & Bit ManipulationEasyAuto-gradedCompute Precision and Recall from Confusion Counts
Compute precision and recall from the four confusion-matrix counts of a binary classifier, returning 0.0 for a metric whose denominator is zero.
Math & Bit Manipulationmathconfusion-matrixprecision-recalledge-cases - Dynamic ProgrammingMediumAuto-gradedLongest Shared Run Between Two Integer Lists
Find the longest block of consecutive values common to two integer lists, and report its length and the smallest pair of start positions, using dynamic programming over suffix matches.
Dynamic Programmingdynamic-programmingarrayssubarraytie-breaking - Arrays & HashingMediumAuto-gradedCheck a Partially Filled Number Grid for Rule Violations
Scan a 9x9 digit grid once and decide whether any row, column, or 3x3 block repeats a digit, using per-group bitmasks or sets.
Arrays & Hashinghashingbitmaskmatrixsimulation - StringsMediumAuto-gradedBoxed Multi-Width Paragraph Formatter
Greedily word-wrap each paragraph to its own width, then frame all resulting lines in one padded ASCII box sized by the widest paragraph limit.
Stringsstringssimulationgreedytext-formatting - StringsMediumAuto-gradedSquash Consecutive Letter-Rearrangement Duplicates
Scan a word list and drop each word that is a letter rearrangement of the previously kept word, testing signature comparison and order-preserving single-pass filtering.
Stringsstringsanagramssimulationtwo-pointers - Arrays & HashingMediumAuto-gradedMaximum Score Level Backed by Enough Servers
Find the largest k such that at least k scores are k or higher, using counting with capped values to reach linear time.
Arrays & Hashingcountingh-indexbucketarrays - Arrays & HashingMediumAuto-gradedConfirmed Connections from Invites and Replies
Match reply events to earlier directed invites, normalize each user pair, and keep the earliest valid reply date per pair, sorted by pair.
Arrays & Hashinghash-mapgroupingdeduplicationdates - Arrays & HashingMediumAuto-gradedMost Common Item Pair Across Shopping Baskets
Find the two products that appear together in the most orders, handling duplicate lines, mirrored pairs, ties, and orders with fewer than two distinct products.
Arrays & Hashinghash-mapcombinationscountinggrouping - Data Structure DesignMediumAuto-gradedCommand-Driven Ledger with Transfer Volume Leaderboard
Simulate an in-memory ledger from text commands, with validated transfers and a leaderboard ranked by outgoing volume with an alphabetical tie-break.
Data Structure Designhash-mapsimulationsortingstring-parsing - Arrays & HashingMediumModel answerSolving Multi-Task Online Assessment Challenges
A guide to solving four standard assessment tasks: cumulative running totals, step-by-step array reduction, deterministic matrix block placement, and linear arithmetic series optimization.
Arrays & Hashingarrayssimulationgridoptimization - Data Structure DesignMediumModel answerBuild an In-Memory Store with Nested Transactions and Value Counts
Design a string key-value store with transactional writes, fast rollback, and a count of keys holding a given value, with all transaction semantics spelled out.
Data Structure Designhash-maptransactionsundo-logdesign - StringsEasyAuto-gradedKeypad Digit Sequence Word Filter
Filter a word list down to the words whose letters, read through a phone keypad, spell out a given digit string, in original order.
Stringsstringshash-mapfilteringsimulation - Data Structure DesignMediumAuto-gradedSimulate a Topic Message Broker with Subscription Tokens
Simulate a topic-based message broker from a command log, handling token issuance, ordered delivery records, and idempotent unsubscribes.
Data Structure Designdesignhash-mapsimulationordering - Stacks & QueuesMediumAuto-gradedRebuild Call Start/Stop Events from Stack Snapshots
Diff consecutive call-stack snapshots by longest common prefix to produce correctly ordered start and end events, including recursion, empty stacks and final closing.
Stacks & Queuesstacksimulationlongest-common-prefixarrays - Linked ListsMediumAuto-gradedFlip Every Block of K Consecutive Values in a Sequence
Reverse each full consecutive block of k elements in a list of values, leaving a short trailing remainder untouched, using the pointer-based linked-list technique.
Linked Listslinked-listin-placepointerssimulation - Data Structure DesignMediumModel answerIn-Memory Calendar Service and Interval Queries
Design and implement an in-memory calendar event service with full CRUD operations, validation rules, conflict detection, and unit testing strategy.
Data Structure Designdesignintervalscrudvalidation - Data Structure DesignMediumModel answerDesign a Weighted Sampling Generator with Dynamic Updates
Implement a class for weighted sampling that supports O(1) sampling for static inputs and logarithmic updates for dynamic environments.
Data Structure Designdesign-dsheaps-sortingmath-bits