practice a little every day — you've got this ♡
Coding Interview 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 2779 results
- Heaps, Sorting & SearchMediumAuto-gradedMaximize Uniform Cut Length for Target Segment Count
Find the maximum integer segment length that can produce at least a specified count of equal-sized pieces using binary search on answer.
Heaps, Sorting & Searchbinary-searcharraysgreedy - Heaps, Sorting & SearchMediumModel answerFill Spare Slots and Sort One Buffer In Place
Combine two unsorted integer lists into the first, which has spare room at its end, so it ends up fully ascending, without using placeholder values to locate the data.
Heaps, Sorting & Searcharrayssortingin-placeheapsort - Arrays & HashingMediumAuto-gradedBucket Words by Letter Multiset Without Per-Word Sorting
Cluster words that share identical letter counts into ordered buckets, using a hashable frequency key rather than sorting each word's letters, while preserving duplicates and order.
Arrays & Hashinghash-mapstringsanagramsfrequency-count - Data Structure DesignMediumAuto-gradedRun-of-K Grid Game Simulator for Many Players
Simulate an N x N, M-player connect-K game with turn order, move validation, win detection from the last move, board snapshots and undo.
Data Structure Designsimulationgriddesignundo - Trees & GraphsMediumAuto-gradedLongest Chain of Accounts Reachable Through Follows
Find the longest simple path from a start node in a directed graph with possible cycles, using backtracking DFS with a per-path visited set.
Trees & Graphsgraphdfsrecursionbacktracking - Arrays & HashingEasyAuto-gradedMonthly Hit Tracks: Overall and Per-Region Leaderboards
Filter streaming events by duration and date window, count plays per track, and produce a global top 5 and per-country top 3 with deterministic tie-breaking.
Arrays & Hashinghash-mapcountingsortinggrouping - StringsMediumAuto-gradedCompressed Word Check Plus Bracket Matching
Tests two linear scans in one function: validating a numeric-skip word abbreviation with two pointers, and checking nested bracket balance with a stack.
Stringstwo-pointersstackstring-parsingvalidation - Arrays & HashingEasyAuto-gradedKeep Only First Appearances in an Integer List
Tests using a hash set alongside a list to filter repeated integers in one pass while preserving first-appearance order, in linear time.
Arrays & Hashinghash-setarraysdeduplicationorder-preservation - Data Structure DesignMediumAuto-gradedRoster Coverage and Rating Leaderboard Simulator
Simulate a command log against a stateful tracker that merges per-agent time intervals and ranks agents by average rating with alphabetical tie-breaking.
Data Structure Designdesignintervalshash-mapsorting - Arrays & HashingMediumAuto-gradedUsers With a Qualifying Login Session in an Unordered Event Log
Pair sign-in and sign-out events per user from an unsorted log using chronological order and FIFO matching, and report users with a session within a time limit.
Arrays & Hashinghash-mapsortingqueuesimulation - Trees & GraphsMediumAuto-gradedFive-Task Toolkit: Graphs, Swaps, Digits, Cache, Trees
Solve five small tasks in one call: count graph components, minimum swaps to sort, largest monotonic number, simulate an LRU cache, and compare two N-ary trees.
Trees & Graphsgraph-traversalcycle-decompositiongreedy-digitslru-cache - Arrays & HashingMediumAuto-gradedSeeded Two-Round K-Means with Spread-Out Starting Centers
Simulate k-means++ seeding with a fixed RNG protocol, then run two assign/update rounds and report clusters, centroids and final squared error.
Arrays & Hashingsimulationclusteringrandomized-samplingfloating-point - Stacks & QueuesMediumAuto-gradedResolve Field Paths in a Nested Message Schema
Parse brace-delimited nested message definitions line by line, then check which dotted query paths name an actual field, tracking scope with a stack.
Stacks & Queuesparsingstackhash-setstrings - Trees & GraphsMediumAuto-gradedTally Separate Clusters of Ones in a Binary Matrix
Count 4-directionally connected clusters of 1s in a binary matrix using graph traversal, with care for visited tracking, empty inputs, and deep clusters.
Trees & Graphsdfsgridconnected-componentsmatrix - Data Structure DesignMediumAuto-gradedBatch-Driven Slash-Path Registry with Leaf-Only Deletion
Simulate a tree-shaped registry addressed by slash-separated paths, processing a batch of create, set, get and remove commands and returning one result per command.
Data Structure Designtriehash-mapdesignstring-parsing - Data Structure DesignHardModel answerDesign an In-Memory Recipe Storage Engine
Design and implement an in-memory storage manager supporting CRUD operations, custom identifier parsing, case-insensitive uniqueness, and controlled renames.
Data Structure Designdesign-dsarraysstrings - Trees & GraphsHardAuto-gradedShortest Looping Command Script for a Fuel-Limited Rover
Brute-force enumerate looping command scripts of length 1 to 10 and simulate each on a grid with fuel, walls and refuel pads, using state-repeat detection to stop loops.
Trees & Graphssimulationbrute-forcegridcycle-detection - Dynamic ProgrammingHardAuto-gradedDaily Vendor Booking with No Immediate Repeats
Choose one vendor per day to minimize total price with no vendor on consecutive days, returning the plan with a fixed tie-break; tests DP, backtracking, and best/second-best.
Dynamic Programmingdynamic-programmingpath-reconstructionoptimizationarrays - Arrays & HashingMediumAuto-gradedLongest Run of Non-Repeating Numbers in an Array
Find the length of the longest contiguous stretch of an integer array in which no value appears twice, using a sliding window with a last-seen index map.
Arrays & Hashingsliding-windowhash-maptwo-pointerssubarray - Math & Bit ManipulationMediumAuto-gradedWorking Days Between Two Dates with a Closure List
Count Monday-to-Friday days in an inclusive date range, skipping listed closure dates, using week arithmetic instead of day-by-day iteration.
Math & Bit Manipulationdatescalendararithmeticsets - Heaps, Sorting & SearchEasyAuto-gradedMinimum Postponed Debits to Avoid Negative Balance
Find the minimum number of negative transactions to postpone so that the running account balance remains non-negative throughout processing.
Heaps, Sorting & Searchheaps-sortinggreedy-intervalsarrays - Arrays & HashingMediumModel answerFix a Failing Budget-Check Module and Add Regression Tests
Debug a small spending-limit module with failing tests: find root causes, fix them, add minimal regression tests, and explain your debugging process and tools.
Arrays & Hashingdebuggingunit-testingroot-cause-analysisfloating-point - Math & Bit ManipulationMediumAuto-gradedSmallest Primes Prefix: Build the First n Primes
Generate the first n primes in ascending order, which tests sieve design with an upper bound derived from a count, plus handling of non-positive n.
Math & Bit Manipulationprimessievenumber-theorymath - Greedy & IntervalsEasyAuto-gradedFilter Financial Logs by Active Premium Periods
Filter a chronological sequence of transaction records based on whether they fall within active premium membership intervals.
Greedy & Intervalsintervalsdata-filteringhash-table - Data Structure DesignMediumAuto-gradedAppend-Only Editor with Undo and Redo Replay
Simulate a tail-only text buffer with undo and redo histories, recording only edits that change the text and clearing redo on every new edit.
Data Structure Designdesignstacksimulationundo-redo - Arrays & HashingMediumAuto-gradedMatch Cells by Four-Way Gap to Nearest Blocker
Compute, for every empty cell, the gap to the nearest blocker in each of four directions using linear sweeps, then return the cells whose four gaps equal a given target.
Arrays & Hashinggridmatrixprefix-sweepsimulation - Arrays & HashingMediumAuto-gradedAssign Persistent Table Column Identifiers
Process sequential database schema snapshots to assign permanent, case-insensitive unique column aliases with automatic collision resolution.
Arrays & Hashingarraysstringsdesign-ds - Data Structure DesignHardModel answerReframing Chunked Async Reads into Length-Prefixed Frames
Turn an async sequence of arbitrarily split byte chunks into complete frames, each preceded by a 4-byte big-endian length, while handling truncation and oversized lengths.
Data Structure Designstreamingstate-machineasyncbinary-parsing - Trees & GraphsMediumAuto-gradedRebuild a Nested Menu Tree from Indented Text
Parse an indentation-based, pipe-delimited menu into a nested tree of dictionaries, testing stack-based hierarchy reconstruction and careful field parsing.
Trees & Graphstree-constructionstackparsingstrings - 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