practice a little every day — you've got this ♡
Coding Interview Problems
Practice 5972 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.
- 5972
- Problems
- 2212
- Auto-graded
- 15
- Topics
- 273
- Added today
Showing 541–570 of 650 results
- Stacks & QueuesMediumModel answerStack Trace Event Stream from Periodic Samples
Convert a sequence of call stack snapshots into function entry and exit events with configurable debouncing to filter transient frames.
Stacks & Queuesstacksarrayssimulationstate-machine - StringsMediumModel answerFive Python Fundamentals: Iteration, Collections, and Edge Cases
Write five short functions covering string repetition, list transformation, FizzBuzz, word counting, and finding the second-largest unique integer.
Stringspythonfundamentalsedge-cases - Data Structure DesignHardModel answerIn-Memory Transaction Ledger with Aliases and History
Implement a timestamped in-memory ledger supporting deposits, cashback transfers, scheduled execution, account merging with alias resolution, and point-in-time balance queries.
Data Structure Designunion-findheapbinary-searchsimulation - Data Structure DesignMediumModel answerConstant-Time Range Queries and Stack with Maximum Tracking
Implement two data structures: one supporting fast interval sum queries on a fixed array, and a stack that efficiently tracks and removes its maximum element.
Data Structure Designprefix-sumstackheapdata-structures - Data Structure DesignMediumModel answerMaintaining a Random Sample from a Stream of Unknown Length
Implement a data structure that keeps k randomly chosen items from a stream where you don't know the total count ahead of time.
Data Structure Designreservoir-samplingstreaming-algorithmsrandomized-algorithms - Arrays & HashingMediumModel answerProportional Stratified Sampling with Largest Remainder Allocation
Sample records from grouped data while preserving stratum proportions, using the largest remainder method to allocate exact counts and seeded random selection.
Arrays & Hashingsamplinggroupinghash-tablerandomization - Trees & GraphsMediumModel answerRobot Grid Exploration with Limited Sensing API
Navigate a robot through an unmapped grid with obstacles using only movement and turn commands to locate a target cell.
Trees & Graphsdfsbacktrackinggraph-traversalsimulation - Trees & GraphsHardModel answerShortest Path for a Hobbled Xiangqi Horse on a 10×9 Board
Find the minimum moves for a Chinese-chess horse to reach a target on a 10×9 grid, accounting for the leg-blocking movement restriction and obstacle squares.
Trees & GraphsBFSgraph traversalboard gamesshortest path - Data Structure DesignMediumModel answerQueue Abstraction Design with Multiple Backing Structures
Design a queue interface and implement it using different data structures, analyzing trade-offs between linked lists, arrays, and stacks.
Data Structure Designobject-oriented-designdata-structurestrade-offs - StringsMediumModel answerCompile a Mini Language to Three-Address Code
Parse a small line-based language of assignments and flat if-else blocks, then emit a deterministic three-address IR with temporaries and jump labels.
Stringsparsingcompilerintermediate-representation - Data Structure DesignMediumModel answerTwo-Player Grid Battle: Terminal Ship Placement and Combat
Build a complete terminal game where two players secretly place ships on grids, then take turns firing until one fleet is destroyed.
Data Structure Designobject-oriented-designgame-logicinput-validationstate-management - Trees & GraphsMediumModel answerRecursive Maximum Search in an Arbitrary Binary Tree
Write a recursive function that traverses a binary tree to locate the largest integer value, accounting for null pointers and negative-only trees.
Trees & Graphsrecursionbinary-treetraversaledge-cases - Trees & GraphsMediumModel answerMulti-Problem Algorithm Sprint: Trees, Grids, and Heaps
Implement six independent algorithm problems covering BST operations, tree traversals, optimization, and graph exploration with correctness and complexity analysis.
Trees & Graphsbinary-treesbinary-search-treesgraph-traversaloptimization - Heaps, Sorting & SearchMediumModel answerStreaming Weighted Reservoir Sampling Without Replacement
Implement a single-pass, memory-efficient weighted sampler that draws k distinct items proportional to weight from a potentially huge stream.
Heaps, Sorting & Searchreservoir-samplingprobabilitynumerical-stabilityheap - Trees & GraphsMediumModel answerMaze Exploration with Limited Sensor API
Explore an unmapped grid using a restricted movement API to find a target location, tracking state through relative coordinates.
Trees & Graphsgraph-traversaldfsstate-trackingbacktracking - Trees & GraphsMediumModel answerEmployee Hierarchy: Counting Trees, Level Traversal, and Ancestor Search
Build a management structure from employee records, then count independent hierarchies, display staff by organizational depth, and locate shared supervisors.
Trees & Graphstree-constructionlevel-order-traversallowest-common-ancestorgraph-fundamentals - Trees & GraphsMediumModel answerResolve Variable Assignments with Dependencies
Parse assignment statements and compute a variable's value by recursively resolving dependencies, detecting cycles and undefined references.
Trees & Graphsrecursiongraphsparsingdfs - Data Structure DesignEasyModel answerBuild an Event Dispatcher with Subscribe and Notify Operations
Design and implement a subscription-based event system where functions can subscribe to event identifiers and be invoked when those events are triggered.
Data Structure Designevent-systemcallbackserror-handlingreentrancy - Data Structure DesignMediumModel answerBuild a Thread-Safe Batched Log Writer
Create a logger that safely accepts messages from multiple threads, buffers them in memory, and writes batches to disk based on size or time triggers.
Data Structure Designconcurrencythreadingproducer-consumerbuffering - Trees & GraphsMediumModel answerGrid Containment: Minimum Removals to Stop Spread
Find the fewest cells to remove from a grid to prevent infection from spreading to healthy neighbors.
Trees & Graphsbipartite-matchinggraph-theorygridvertex-cover - Trees & GraphsMediumModel answerCompute Direct and Total Network Reach for Each User
Given a list of sponsor–member pairs, return the direct and full downstream unique reach count for every user, handling duplicates, converging paths, and cycles.
Trees & GraphsgraphsBFSreachabilitycycles - Data Structure DesignHardModel answerAmusement Park Tap-to-Ride: Credits, Surcharges, and Refunds
Simulate a wristband payment system that drains expiring credits before a linked card, applies zone-based surcharges, and splits refunds back across both funding sources.
Data Structure Designsimulationpriority-queuestate-management - Data Structure DesignMediumModel answerBuild a Fox-and-Geese Turn-Based Grid Game Engine
Model the board state, movement rules, and win conditions for an asymmetric two-player grid game where geese try to reach the far side while foxes hunt them.
Data Structure Designobject-oriented designgame enginesimulationstate machine - Data Structure DesignHardModel answerTiered Cache Manager with Expiry and Weighted Retrieval
Implement a multi-level cache that evicts expired entries, checks tier utilization, and retrieves the highest-weight item from any eligible tier.
Data Structure Designheaplazy-deletionmulti-levelexpiration - Data Structure DesignMediumModel answerFirewall Rule Engine with Prefix Matching
Build a rule-based IP filter supporting CIDR blocks, priority resolution, and efficient queries for single IPs and prefix ranges.
Data Structure Designtrienetworkingbit-manipulation - Math & Bit ManipulationMediumModel answerInfer Numeric Pattern and Identify Corrupted Element
Determine which mathematical pattern a sequence follows, detect if one value is wrong, and predict the next term.
Math & Bit Manipulationsequencespattern-recognitionedge-cases - Data Structure DesignMediumModel answerTransactional Key-Value Store with Rollback Support
Build a key-value store supporting nested transactions with set, get, delete, begin, commit, and rollback operations.
Data Structure Designtransactionsstackstate-managementkey-value-store - Trees & GraphsMediumModel answerChain Fragment Payloads by Matching Tags
Order tagged fragments so each fragment's ending tag matches the next fragment's starting tag, then concatenate their payloads into a single output string.
Trees & Graphsgraphsstring-manipulationgraph-traversal - Data Structure DesignMediumModel answerFinding Consecutive Duplicates in Subarrays
Design data structures to efficiently detect sequences of identical elements in an array and answer queries about their presence in suffixes.
Data Structure Designarray-scanningpreprocessingrange-queries - Data Structure DesignMediumModel answerBuild a Policy Engine for Expense Validation
Create a rule evaluation system that checks expense submissions against JSON-defined policies without deploying new code.
Data Structure Designdata-structuresparsingvalidation