practice a little every day — you've got this ♡
Coding Interview Problems
Practice 6033 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.
- 6033
- Problems
- 2234
- Auto-graded
- 15
- Topics
- 274
- Added today
Showing 1711–1740 of 2787 results
- Trees & GraphsMediumAuto-gradedAssemble Tree from Edge Specifications
Tests building a tree structure from unordered edge list by tracking node relationships and identifying the root.
Trees & Graphstreeshash-tablegraph-construction - Data Structure DesignMediumAuto-gradedVersioned Key-Value Store with Global Version Tracking
Implement a key-value store where each write increments a global version counter and reads retrieve values by version using binary search.
Data Structure Designbinary-searchdata-structuresversioning - Trees & GraphsMediumAuto-gradedEqual Binary Digits and Ascending Tree Chain
Tests prefix-sum balancing for binary arrays and depth-first search for strictly increasing root-to-leaf paths in binary trees.
Trees & Graphstreesarraysprefix-sumdfs - Math & Bit ManipulationMediumAuto-gradedTwo-Year Show Profit: Renewal vs. New Launch
Compute two-year profits for two show options, blend the new show's outcomes by success probability, and find the break-even probability.
Math & Bit Manipulationarithmeticexpected-valuebreak-evenbusiness-math - Data Structure DesignMediumModel answerDynamic Hierarchy Manager with Timestamp Ordering
Build a system that processes timestamped parent-child updates arriving in any order, maintains a valid tree structure, and prevents cycles.
Data Structure Designtreesgraphsstate-managementcycle-detection - StringsHardAuto-gradedEncode Consecutive Character Runs as Digit Sequences
Tests run-length encoding with multi-digit counts split into individual characters, requiring careful pointer management and constant-space thinking.
Stringstwo-pointersrun-length-encodingin-place - Arrays & HashingMediumAuto-gradedGrid Walker with Blocked Cells
Tests simulation with hash-based obstacle lookup, movement logic, and tracking a running maximum over coordinate positions.
Arrays & Hashingsimulationhash-setgrid - Heaps, Sorting & SearchMediumAuto-gradedMerge Sorted Event Streams with Running Sum
Tests k-way merging of pre-sorted sequences using a min-heap, deterministic tie-breaking by source index, and accumulating a running total across all events.
Heaps, Sorting & Searchheapmergek-way-mergerunning-sum - Dynamic ProgrammingMediumAuto-gradedScore Bust Probability: Stop When You Hit the Target
Tests whether a candidate can build an O(n) sliding-window DP to compute the probability that a random accumulation process stops within a given score ceiling.
Dynamic Programmingdynamic-programmingsliding-windowprobability - Trees & GraphsMediumModel answerContent-Based Duplicate File Detector
Recursively scan a directory tree, group files by size then content hash, and return every set of two or more paths that hold identical bytes.
Trees & Graphshashingfile-systemtraversaldeduplication - StringsMediumAuto-gradedMultiply Large Numbers as Strings
Tests implementation of grade-school multiplication on arbitrarily large integers represented as strings without using built-in big integer operations.
Stringsmathsimulationarray-manipulation - Data Structure DesignMediumModel answerDesign a Five-Card Hand Evaluator with Partial Hand Completion
Model poker-style five-card hands with an abstract type hierarchy, compare two hands by strength and tie-break, then find the strongest and weakest completions of a partial hand.
Data Structure Designobject-oriented designclassificationcombinatoricscomplexity analysis - Arrays & HashingMediumAuto-gradedSingle Buy-Sell Transaction for Maximum Gain
Tests optimal single-pass tracking of minimum buy price to maximize profit from one stock transaction.
Arrays & Hashingarraysgreedyoptimizationsingle-pass - Arrays & HashingMediumAuto-gradedBuild Sorted Email Event Timeline for Subscriptions
Tests date arithmetic, multi-level sort stability, and designing a rule system that cleanly handles event ordering and extensibility.
Arrays & Hashingsortingdatessimulation - Data Structure DesignMediumModel answerConcurrent Task Execution with Type-Level Exclusion
Build a synchronization mechanism allowing tasks of the same type to run together while blocking tasks of different types from overlapping.
Data Structure Designconcurrencythreadingsynchronization - Data Structure DesignMediumAuto-gradedSimulate a Linked List with Iterator and Transform
Tests ability to implement a doubly-linked list supporting sequential iteration and non-mutating element-wise transformation via a command-driven simulation.
Data Structure Designlinked-listiterator-patternhigher-order-functions - Data Structure DesignMediumModel answerDefensive Coding: Validate and Harden a Snake Game
Design an input-validation strategy, error-handling policy, and test suite to protect a Snake game implementation from every class of bad input.
Data Structure Designvalidationerror-handlingtestingsnake-game - Heaps, Sorting & SearchMediumAuto-gradedMerge K Sorted Lists to Find Smallest Elements
Tests efficient multi-way merge using a min-heap to extract the k smallest values from multiple sorted arrays without flattening the entire input.
Heaps, Sorting & Searchheapmergesortingoptimization - Data Structure DesignMediumAuto-gradedFixed-Capacity Eviction Cache with Recency Tracking
Tests whether you can design a cache that evicts the least recently accessed entry in O(1) time by combining a hash map with an ordered structure.
Data Structure Designhash-maplinked-listdesigncache - Trees & GraphsMediumModel answerFind the Longest Path in an Undirected Tree
Given a tree as an adjacency list, return the sequence of nodes forming its diameter — the longest simple path between any two nodes.
Trees & GraphsBFSDFStree diameterpath reconstruction - Heaps, Sorting & SearchHardModel answerRolling Window Median Bounds + Binary Array Tiling
Find the max and min sliding-window medians in O(n log k), then partition a binary array into even uniform segments with minimum flips.
Heaps, Sorting & Searchsliding windowheapdynamic programmingbinary array - Trees & GraphsHardAuto-gradedDetect a Profitable Currency Trade Loop
Tests whether you can model exchange rates as a weighted directed graph and apply Bellman-Ford to detect a cycle whose rate product exceeds 1.
Trees & Graphsgraphsbellman-fordlogarithms - Arrays & HashingMediumModel answerLayered Invoice Processor with Discounts, Tax, and FX
Build a multi-part order cost engine that handles input validation, per-item discounts, order-level tax, multi-currency conversion, and banker's rounding.
Arrays & Hashingdata-processingdecimal-arithmeticinput-validationsorting - Trees & GraphsMediumAuto-gradedReachable Stocked Nodes Within a Hop Limit
Tests BFS on an undirected graph to filter nodes by shortest-path distance and a secondary inventory condition, including edge-case handling for missing keys and duplicates.
Trees & Graphsbfsgraphsshortest-path - Data Structure DesignHardModel answerBuild a Subscription Pattern Recognition Engine
Create a system that discovers recurring billing patterns in transaction data, handling merchant name variations, timing drift, and price changes.
Data Structure Designpattern-recognitiondata-processingheuristics - Data Structure DesignMediumModel answerBuild an In-Memory Promo Code Service
Design and implement a class that creates, validates, and redeems promotional discount codes with expiry, global and per-user limits, and idempotent retries.
Data Structure Designhash-mapexpirationidempotencyconcurrency - Math & Bit ManipulationMediumAuto-gradedFewest Steps to Reach One
Tests greedy reasoning over binary structure to find the minimum number of halving and increment/decrement steps needed to reduce a positive integer to 1.
Math & Bit Manipulationgreedybit-manipulationmath - Data Structure DesignMediumModel answerDesign a Multiset Trie with Fast Prefix Counting
Build a trie that tracks word multiplicities, supports insertion, deletion, exact and prefix lookup, and handles Unicode safely.
Data Structure Designtriedata-structuresconcurrencyunicode - Arrays & HashingMediumAuto-gradedCount Members With Continuous Subscription at Final Timestamp
Tests per-entity state simulation where a subscription can only be renewed while still active, and any lapsed subscription is permanently void.
Arrays & Hashingsimulationhash-mapstate-machine - Data Structure DesignMediumAuto-gradedBoard Game: Detect k-in-a-Row on a Rectangular Grid
Tests incremental win detection on an m×n board by tracking consecutive run lengths at endpoints to check for k-in-a-row in O(1) per move.
Data Structure Designdesignarrayssimulation