practice a little every day — you've got this ♡
Stacks & Queues Interview Problems
Practice 5969 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.
- 5969
- Problems
- 2211
- Auto-graded
- 15
- Topics
- 272
- Added today
Showing 61–90 of 112 results
- Stacks & QueuesEasyAuto-gradedNested Delimiter Checker for Config Expressions
Checks whether a string of mixed parentheses, braces, and square brackets is properly nested, testing stack-based matching and early rejection in linear time.
Stacks & Queuesstackparsingstringmatching - Stacks & QueuesMediumModel answerGroup Deletion Stack and Boundary Path Collection
Remove consecutive identical-character groups from a string and collect a binary tree's boundary nodes in a specific mirror order.
Stacks & Queuesstackbinary-treestring-manipulationrun-length-encoding - Stacks & QueuesMediumModel answerCompute Per-Function Runtimes from a Profiler Event Log
Parse a time-ordered sequence of START/END events, compute inclusive and exclusive runtimes per function, and identify the most expensive function by self-time.
Stacks & Queuesstacksimulationprofilingcall-stack - Stacks & QueuesHardAuto-gradedReconstruct Function Lifetimes from Periodic Stack Snapshots
Tests ability to diff consecutive call-stack snapshots using longest-common-prefix analysis and stack unwinding to produce ordered START/END lifecycle events.
Stacks & Queuesstacksimulationtwo-pointers - Stacks & QueuesHardAuto-gradedPeak Values in Fixed-Length Subarrays
Tests understanding of monotonic deques to efficiently track the largest element across consecutive fixed-size subarrays in linear time.
Stacks & Queuesdequesliding-windowmonotonic-queue - Stacks & QueuesMediumModel answerMaximize Throughput in a Serial Manufacturing Pipeline
Design and simulate a fixed-time serial pipeline to maximize completed units, given per-stage processing times, inter-stage buffer capacities, and blocking-after-service rules.
Stacks & Queuessimulationschedulingqueuesthroughput - Stacks & QueuesEasyAuto-gradedBalanced Delimiter Validation with a Stack
Decide whether a bracket-only string is properly nested and matched, using a LIFO stack of pending openers.
Stacks & Queuesstackstringsparsing - Stacks & QueuesHardAuto-gradedSimulate a FIFO Queue with Two Stacks
Tests whether you can emulate first-in-first-out ordering using only two LIFO stacks and explain the amortized cost of each operation.
Stacks & Queuesstacksqueueamortized-analysis - Stacks & QueuesMediumAuto-gradedSingle-Threaded CPU: Exclusive Runtimes and Stack Snapshot
Tests stack simulation and interval reasoning by computing per-function exclusive execution time and reconstructing the active call stack at a query timestamp from a sorted event log.
Stacks & Queuesstacksimulationinterval-reasoning - Stacks & QueuesHardModel answerBuild a Type-Safe C++ Stack from Raw Storage
Implement a generic, dynamically growing C++ stack using raw memory and placement new, then defend every lifetime, allocation, and call-semantics decision.
Stacks & QueuesC++memory-managementtemplatesobject-lifetime - Stacks & QueuesMediumAuto-gradedBracket Nesting Check and Rotating Cipher
Tests stack-based bracket validation and modular arithmetic to rotate lowercase letters circularly across the alphabet.
Stacks & Queuesstacksstringsmodular-arithmetic - Stacks & QueuesMediumAuto-gradedCalculate Arithmetic Expression with Negation and Grouping
Tests building an operator-precedence parser using stacks to handle binary operations, unary negation, parentheses, and zero-truncating division.
Stacks & Queuesstacksparsingoperator-precedencestring-processing - Stacks & QueuesMediumAuto-gradedCascade Removal of Equal Neighbor Groups
Tests stack-based simulation of iterative removals that trigger chain reactions when fragments recombine.
Stacks & Queuesstackstringsimulation - Stacks & QueuesMediumAuto-gradedSkyline Visible Buildings Count
Tests ability to use a monotonic stack to count, for each building, how many previous buildings are visible looking back from it along a city skyline.
Stacks & Queuesmonotonic stackarrayssimulation - Stacks & QueuesMediumAuto-gradedBracket Matching, Interval Union, and Expression Parsing
Tests stack-based bracket validation, interval merging with endpoint semantics, and arithmetic evaluation with unary operators.
Stacks & Queuesstacksintervalsparsingexpression-evaluation - Stacks & QueuesMediumAuto-gradedTrim a Bracket String to Its Longest Balanced Form
Tests stack-based bracket matching: find and remove the fewest characters from a parentheses-only string to leave a fully balanced result.
Stacks & Queuesstacksstringsgreedy - Stacks & QueuesMediumAuto-gradedIdentify Invalid Parentheses for Removal
Tests stack-based matching to find the minimum set of parenthesis indices that must be removed to balance a string.
Stacks & Queuesstackstring-processinggreedy - Stacks & QueuesEasyAuto-gradedValidate Nested Chemical Formula Brackets
Tests bracket matching with domain-specific pairing rules where round, square, and curly brackets each have distinct valid nesting constraints.
Stacks & Queuesstacksbracket matchingsimulationstrings - Stacks & QueuesMediumAuto-gradedCompute Arithmetic Expression with Operator Precedence
Tests parsing and evaluating mathematical expressions with proper operator precedence and parentheses using stack-based techniques.
Stacks & Queuesstacksexpression-parsingoperator-precedence - Stacks & QueuesMediumAuto-gradedConcert Venue Ticketing with Capacity and a Waiting Line
Tests event-driven simulation skills: tracking visitor state, enforcing a seating capacity, managing a FIFO waitlist, and collecting one-time entry fees.
Stacks & Queuessimulationqueuehash-set - Stacks & QueuesHardAuto-gradedPeak Tower Configuration with Height Limits
Construct a sequence that rises then falls while respecting per-element caps, maximizing the sum using greedy peak selection and monotonic stacks.
Stacks & Queuesmonotonic-stackgreedyprefix-sum - 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 - Stacks & QueuesMediumAuto-gradedLexicographically Smallest Digit Sequence from Rise/Fall Pattern
Tests greedy thinking and stack-based reversal to build the smallest digit string satisfying a sequence of increase and decrease constraints.
Stacks & Queuesgreedystackstrings - Stacks & QueuesMediumAuto-gradedCompute an Arithmetic Expression Honoring Operator Precedence
Tests ability to parse and compute integer arithmetic respecting operator precedence without using eval or a full expression parser.
Stacks & Queuesparsingoperator-precedencestack - Stacks & QueuesMediumAuto-gradedEvaluate Nested Arithmetic Brackets with Sign Propagation
Tests expression evaluation using a monotonic/simulation stack to handle deeply nested signed bracket expressions with +/- operators and integer literals.
Stacks & Queuesstacksexpression evaluationparsingsimulation - Stacks & QueuesMediumAuto-gradedEvaluate Arithmetic Expression with Operator Precedence
Tests implementation of expression evaluation using stacks to handle operator precedence and parentheses correctly.
Stacks & Queuesstackexpression-parsingoperator-precedence - Stacks & QueuesMediumAuto-gradedCompute Arithmetic Expression with Operator Precedence
Tests ability to parse and evaluate arithmetic expressions respecting operator precedence and left-to-right associativity without built-in eval.
Stacks & Queuesparsingoperator-precedencemathstring-processing - Stacks & QueuesMediumAuto-gradedDays Until Higher Temperature
Tests efficient computation of the distance to the next strictly greater element using a monotonic stack to achieve linear time complexity.
Stacks & Queuesmonotonic-stacknext-greater-elementarrays - Stacks & QueuesMediumAuto-gradedCollapse Matching Neighbors
Tests stack-based simulation to eliminate adjacent equal characters iteratively until no more cancellations are possible.
Stacks & Queuesstackstring-manipulationsimulation - Stacks & QueuesHardAuto-gradedCheck Balanced Brackets and Find Tree Level Width
Tests stack-based matching for nested brackets and BFS position tracking to compute maximum horizontal distance in a binary tree.
Stacks & Queuesstackbfstree-traversalstring-validation