practice a little every day — you've got this ♡
Coding Interview Problems
Practice 6002 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.
- 6002
- Problems
- 2223
- Auto-graded
- 15
- Topics
- 273
- Added today
Showing 571–600 of 2776 results
- StringsMediumAuto-gradedShared-Letter Splits and Best Uniform Bundles
Count string split points whose halves share more than k distinct characters, and find the most equal-total bundles of one or two items from a cost list, with a special rule for zero-cost items.
Stringsstringshash-mapcountingprefix-suffix - Trees & GraphsMediumAuto-gradedBest Meeting Cell on a Grid with Walls
Find the open cell with the smallest total shortest-path distance to a set of target cells on a grid with obstacles, using BFS and reachability counting.
Trees & Graphsbfsgridshortest-pathgraph-traversal - Trees & GraphsMediumAuto-gradedTree Depth After Splicing Out Removed Nodes
Compute the depth of a rooted tree given as a parent array after splicing out marked nodes, so their children attach to the nearest surviving ancestor.
Trees & Graphstreebfsparent-arraydepth - Heaps, Sorting & SearchEasyAuto-gradedStream Median Tracker
Process a series of dynamic data stream queries to compute the median on demand using heap-based structures.
Heaps, Sorting & Searchheapsheapqdata-structuresdesign-ds - Data Structure DesignMediumAuto-gradedMost Connected User Tracker with Variable Top-K Queries
Maintain distinct-contact counts for users from undirected messages, answer the top user in O(1), and return a top-k list with deterministic tie-breaking.
Data Structure Designhash-sethash-mapheapsimulation - Stacks & QueuesMediumAuto-gradedStrip Unmatched Brackets From a Text Line
Delete exactly the brackets that cannot be paired so the remaining text is well-formed, using a single linear scan with a stack or counters.
Stacks & Queuesstackstringparenthesesgreedy - Dynamic ProgrammingMediumAuto-gradedCalculate Processed Work Units in Pipelined Task Queues
Simulate task batch execution across a sequential multi-stage pipeline and count total units completed within a time limit.
Dynamic Programmingarrayssimulationdynamic-programminggreedy-intervals - Dynamic ProgrammingMediumAuto-gradedBest Haul from a Line of Stalls Without Neighbors
Compute the maximum total from a line of non-negative numbers when no two neighboring entries may both be picked, using linear-time dynamic programming.
Dynamic Programmingdynamic-programmingarraytake-or-skiphouse-robber - StringsMediumAuto-gradedExpand a Compact Letter-and-Count String
Parse a string of letters with optional multi-digit repeat counts, treating a missing count as one, and rebuild the expanded text in a single left-to-right pass.
Stringsstring-parsingtwo-pointerssimulationrun-length-encoding - Trees & GraphsMediumAuto-gradedBest Multi-Hop Exchange Rate Between Two Currencies
Find the largest product of directed exchange rates along any path between two currencies, using Bellman-Ford-style relaxation on a graph that may contain cycles and rates above 1.
Trees & Graphsgraphbellman-fordshortest-pathcurrency - Data Structure DesignHardModel answerHardening a Coalescing TTL Cache: Failures, Invalidation, Eviction
Review a promise-coalescing TTL cache in TypeScript, find its failure, invalidation and memory bugs, write a fixed version, and explain how to port it safely to multithreaded C++20.
Data Structure Designasynccacherace-conditionslru - Trees & GraphsEasyAuto-gradedGrid Zone Coloring Feasibility
Determine whether empty grid plots can be assigned one of k colors without adjacent conflicts.
Trees & Graphstrees-graphsarraysmath-bits - Stacks & QueuesEasyAuto-gradedRight-Side Larger Neighbor Lookup for Selected Values
Tests whether you can precompute the nearest strictly larger value to the right for every element using a monotonic stack, then answer lookups for a chosen list of values.
Stacks & Queuesmonotonic-stackhash-maparrays - Trees & GraphsMediumAuto-gradedGrid Contagion Simulation
Simulate multi-source BFS propagation across a 2D grid up to a maximum number of steps.
Trees & Graphsbreadth-first-searchmatrixgraph-traversal - Trees & GraphsMediumModel answerTwo Warm-Ups: One-Deletion Palindrome and Column-Grouped Tree Output
Decide whether a string becomes a palindrome after removing at most one character, then group a binary tree's node values by column using level-order tie-breaking.
Trees & Graphstwo-pointerspalindromebfsbinary-tree - Trees & GraphsMediumAuto-gradedEarliest Finish Time for a Dependent Job Pipeline
Compute the shortest total time to finish all jobs with unlimited parallelism by finding the longest weighted path in a dependency graph, returning -1 if a cycle exists.
Trees & Graphstopological-sortdaglongest-pathdynamic-programming - Data Structure DesignEasyAuto-gradedIn-Memory Store with Transaction Layering
Implement an in-memory key-value database supporting GET, SET, DELETE, and nested transaction semantics (BEGIN, ROLLBACK, COMMIT).
Data Structure Designdesign-dsstacks-queuesarraysstrings - Arrays & HashingMediumAuto-gradedCount Contiguous Runs That Add Up to a Goal
Count contiguous non-empty subarrays whose elements sum to a goal value, using running prefix sums with a frequency map to handle negatives and zeros in linear time.
Arrays & Hashingprefix-sumhash-mapsubarraycounting - Data Structure DesignMediumAuto-gradedPath-Addressed Tree Store: Replay a Command Log
Simulate a path-keyed tree store by replaying a list of commands, testing trie or hash-map design, path validation, and exact failure semantics.
Data Structure Designdesigntriehash-mapsimulation - Data Structure DesignMediumModel answerBuild an In-Memory Price History Store with One-Shot Updates
Design a per-symbol price store supporting lookups, custom change formulas, atomic range updates that can touch each slot only once, and a switch from daily to hourly data.
Data Structure Designdata-structure-designtime-seriesatomic-updateshash-map - Data Structure DesignHardAuto-gradedBest-Fit Block Allocator with Coalescing and Log-Time Operations
Simulate a best-fit extent allocator over a huge block range, where reserve and release must merge adjacent free runs and run in logarithmic time.
Data Structure Designdesignordered-settreapcoalescing - Greedy & IntervalsMediumAuto-gradedFewest Rooms to Host All Bookings
Find the smallest number of rooms that can host every booking at once, where a booking may begin the moment another one ends, using sorting and a min-heap.
Greedy & Intervalsintervalsmin-heapsortinggreedy - Arrays & HashingMediumAuto-gradedTightest Window Covering K Different Values
Find the minimum length of a contiguous block of an integer list containing at least k different values, using a sliding window with a frequency map.
Arrays & Hashingsliding-windowtwo-pointershash-map - Data Structure DesignMediumAuto-gradedBatch Simulation of Conflict-Free Node Locks on a Rooted Tree
Process a batch of lock, unlock and query operations on a rooted tree where no locked node may be an ancestor or descendant of another, using subtree ranges and Fenwick trees.
Data Structure Designtreeeuler-tourfenwick-treedesign - StringsMediumAuto-gradedFill Placeholders in a Chained Request Template
Recursively resolve {{dotted.path}} placeholders in a nested request, keeping native types for whole-string matches and stringifying embedded ones.
Stringsrecursionregexjsontemplate-substitution - Data Structure DesignMediumAuto-gradedSimulate a Multi-User File Store with Quotas and Compression
Simulate a command-driven in-memory file store with ownership, per-user quotas, prefix/suffix search, quota-driven eviction and size-changing renames.
Data Structure Designdesignhash-mapsimulationsorting - Data Structure DesignMediumModel answerBinary Wire Format for a Nested Key-Value Map
Design and implement a versioned, checksummed binary format that converts a nested key-value map to bytes and back, and compare it with JSON and MessagePack.
Data Structure Designserializationbinary-formatchecksumversioning - Heaps, Sorting & SearchMediumAuto-gradedCombine Several Pre-Sorted Lists Into One Sorted List
Tests merging K nondecreasing integer lists into a single sorted list, preserving duplicates and handling empty lists, using a heap or pairwise merging.
Heaps, Sorting & Searchheapmergek-way-mergesorting - Greedy & IntervalsMediumAuto-gradedFewest Segment Boosts to Make a Sequence Non-Decreasing
Compute the minimum number of +1 contiguous-segment updates needed to make an array non-decreasing, using adjacent differences and a lower-bound argument.
Greedy & Intervalsdifference-arraygreedyarraysrange-updates - Data Structure DesignHardModel answerDesign an In-Memory Sentence Search Index
Design a data structure that supports adding, removing, and efficiently querying sentences by keyword in real time.
Data Structure DesignData Structure DesignInverted IndexStringHash Table