practice a little every day — you've got this ♡
Coding Interview 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
- 274
- Added today
Showing 661–690 of 2780 results
- Arrays & HashingEasyAuto-gradedKeep First Record Per Login ID in Linear Time
Filter a list of record dictionaries so only the first record for each identifier remains, preserving order and doing it in a single linear pass with a hash set.
Arrays & Hashinghash-setdeduplicationarraysorder-preservation - Data Structure DesignMediumModel answerConcurrent Micro-Batching Writer with Backpressure and Timed Flush
Build a thread-safe buffer that accepts records from many producers and writes them to a database in batches, triggered by size, age of the oldest record, or shutdown, without holding locks during I/O.
Data Structure Designconcurrencycondition-variablesbackpressurebatching - Greedy & IntervalsEasyAuto-gradedPartition Array Under Segment Capacity Limit
Determine the minimum number of contiguous segments needed to split an array such that no segment's total sum exceeds a specified capacity limit.
Greedy & Intervalsarraysgreedy - Arrays & HashingMediumAuto-gradedFind Unique Integer Triplets Summing to Target
Finds all unique value triplets in an integer array that sum to a specified target using sorting, two-pointer scanning, and pruning.
Arrays & Hashingarraystwo-pointerssortingdeduplication - Heaps, Sorting & SearchMediumAuto-gradedLongest Equal Cable Segment From Spools
Find the largest integer segment length such that cutting every spool into equal segments yields at least k segments, using binary search on a monotonic feasibility check.
Heaps, Sorting & Searchbinary-searchbinary-search-on-answermonotonic-predicatearrays - Data Structure DesignMediumModel answerBuild a Shutdown-Aware Producer/Consumer Queue in C++
Design a generic, thread-safe C++ queue where consumers block when it is empty and a shutdown call releases every waiting thread once the remaining items are drained.
Data Structure Designcppconcurrencymutexcondition-variable - Heaps, Sorting & SearchMediumModel answerExact Mode, Median and Balanced Sort Over Ten Message-Passing Nodes
Integers live on ten machines that can only exchange messages. Write per-node programs for the exact mode, the median and a balanced global sort while sending as little data as possible.
Heaps, Sorting & Searchdistributed-systemsmapreducesample-sortselection - Trees & GraphsEasyAuto-gradedNearest Node in a Binary Search Tree
Find the value in a Binary Search Tree represented as a level-order array that has the smallest absolute difference to a target number.
Trees & Graphstrees-graphsbinary-search-treesearch - Data Structure DesignMediumModel answerExpiring Store, Reversible Actions, and Org Chart Walk
Three short design-and-code tasks: a key-value store with per-entry lifetimes and background pruning, an action history with undo/redo, and a depth-first walk over a hierarchy.
Data Structure Designcachettlmin-heapundo-redo - Data Structure DesignMediumModel answerPhoto Slideshow with Ranked Comment Threads and Safe Voting
Design a slideshow widget plus per-photo comment threads with idempotent voting and fast top-k ranking, scaling to 10^5 photos and 10^6 comments.
Data Structure Designdata-structure-designsorted-indexidempotencypagination - Trees & GraphsMediumAuto-gradedFewest Moves Through a Walled Maze
Compute the minimum number of 4-directional moves between two open cells of a binary maze, or -1 if unreachable; tests breadth-first search on an implicit grid graph.
Trees & Graphsbfsgridshortest-pathgraph - StringsMediumAuto-gradedOrder Distinct Letters-Only Tokens by Popularity
Extract case-insensitive ASCII-letter tokens from text, count them, and list the distinct words by descending count with alphabetical tie-breaks.
Stringshash-mapstring-parsingsortingfrequency-count - Data Structure DesignEasyModel answerPython Tuples, Dict Internals, and Error Handling in a Record Store
Answer three fundamentals questions: tuple rebinding and shallow immutability, how a hash table handles insert, lookup, update and delete, and where to raise and catch errors in a record class.
Data Structure Designpythonimmutabilitytupleshash-table - Math & Bit ManipulationEasyAuto-gradedCalculate Credit Card Portfolio Metrics and Partnership Break-Even
Computes the annual net contribution per card, overall portfolio profit, and the minimum number of new accounts needed to cover a marketing campaign.
Math & Bit Manipulationmathfinancial-modelingarithmetic - Heaps, Sorting & SearchMediumAuto-gradedRoute Jobs to Workers with Account Stickiness
Simulate FIFO dispatch of tasks to workers with a preference for each account's last worker, using heaps and a lookup table to track free and busy workers.
Heaps, Sorting & Searchheapsimulationschedulinghash-map - Math & Bit ManipulationMediumModel answerEight Number Puzzles: Spot the Rule, Predict the Next Value
Work out the hidden rule behind eight short numeric and fractional sequences, state the next term for each, and justify it against every given term.
Math & Bit Manipulationsequencespattern-recognitionrecurrence-relationsmental-math - Data Structure DesignMediumAuto-gradedEarliest Non-Repeating ID in a Live Feed Replay
Replay a sequence of operations on a stream of integer IDs and report, at each query, the earliest-arriving ID seen exactly once, using a hash map plus an ordered queue.
Data Structure Designhash-mapqueuedesignstreaming - Arrays & HashingEasyAuto-gradedFind All Top-Frequency Labels Without Using max()
Count items by their string form and return every label tied for the highest count, in first-appearance order, without calling max().
Arrays & Hashinghash-mapcountingfrequencyties - Heaps, Sorting & SearchMediumAuto-gradedGroup and Rank Feed Items with Photo Bundling
Rearrange feed items by sorting on rank score, grouping photos into batches of up to three, and maintaining stable ordering for equal scores.
Heaps, Sorting & Searchsortingarraysbatching - Data Structure DesignMediumAuto-gradedBatch Autocomplete Lookup Over a Dictionary of Words
Answer many prefix queries against a word list, returning sorted distinct matches for each, using sorting and binary search or a trie instead of rescanning the list per query.
Data Structure Designbinary-searchtriesortingstrings - Linked ListsEasyAuto-gradedCombine Two Sorted Sequences
Merge two non-decreasing sequences into a single sorted sequence, maintaining stable order on equal values.
Linked Liststwo-pointerslinked-listarrayssorting - StringsMediumModel answerStream Data Processing with Early Cutoff on Sequence Detection
Yield data from a continuous stream of string fragments, terminating immediately when a specific multi-character sequence is identified across fragment boundaries.
Stringsstringssliding-windowtwo-pointerskmp - Trees & GraphsHardModel answerFastest Route Through Only the Courses a Goal List Needs
Given courses with durations, prerequisite links and a list of goal courses, compute the minimum time to finish the goals and their needed prerequisites, as total effort and as elapsed time.
Trees & Graphsgraphtopological-sortdagcycle-detection - Data Structure DesignMediumModel answerCoalescing Single-Key Reads into Timed Batch Requests
Build a callback-driven client that gathers individual key requests into one batched GET every 100 ms, using only a timer and an async HTTP primitive, while keeping overlapping batches isolated.
Data Structure Designevent-loopbatchingcallbackstimers - Arrays & HashingMediumAuto-gradedPossible Minimum Excluded Values After One Increment
Find all possible values of the minimum non-negative excluded integer (MEX) achievable after at most one element increment.
Arrays & Hashingarrayshash-tablefrequency-arraymath - Data Structure DesignEasyAuto-gradedLog Event Processor with Time Order
Tests data structure management and stable sorting to process out-of-order time-stamped events while preserving insertion order for ties.
Data Structure Designsortingdata-structuresdesign - Greedy & IntervalsMediumAuto-gradedLongest Streak of Growing Daily Distinct Picks
Find how many days a growing-size distinct-item picking schedule can run, using binary search on the answer plus a capacity feasibility check.
Greedy & Intervalsgreedybinary-searchprefix-sumsfeasibility-check - Greedy & IntervalsHardAuto-gradedSimulate Trading Order Fill Rate Limit
Simulate order executions under a time-windowed volume participation constraint using a sliding window.
Greedy & Intervalssliding-windowqueuegreedytime-series - Trees & GraphsMediumAuto-gradedValidate Binary Tree from Directed Edge List
Evaluates tree properties, cycle detection, edge validity, and in-order traversal under strict error precedence.
Trees & Graphstreesgraphsdfstraversal - Greedy & IntervalsMediumAuto-gradedCollapse Booking Windows into Non-Touching Blocks
Merge inclusive ranges that share at least one point into a sorted list of disjoint ranges, testing sorting, a linear sweep, and correct handling of touching endpoints and nesting.
Greedy & Intervalsintervalssortingsweepgreedy