Topic
Stacks & Queues interview problems
Monotonic stacks, parsing and simulation. 112 original problems, each with hidden test cases you can run in the browser.
22 easy74 medium16 hard
Showing 91–112 of 112 results
Write a parser that evaluates arithmetic expressions with integers, four operators, parentheses, and unary negation using recursive descent or explicit stack DFS.
Model answerrecursionparsingoperatorsdfsTests monotonic stack usage to efficiently find next smaller-or-equal elements and aggregate results with index tracking.
Auto-gradedmonotonic-stackarraysaggregationTests deep bracket-matching with multiplicative expansion rules by validating and evaluating a chemical-formula-style string with nested parentheses and numeric multipliers.
Auto-gradedstacksbracket matchingparsingsimulationTests whether candidates can simulate bracket-matching logic with named tags, enforcing strict open/close pairing and proper nesting order.
Auto-gradedstacksbracket matchingparsingsimulationTests expression evaluation using a monotonic/operator-precedence stack to correctly parse and compute a string containing +, -, *, /, parentheses, and nested ternary operators.
Auto-gradedstacksexpression evaluationparsingmonotonic stackTests stack trace interpretation, event inference from sparse data, and algorithmic reasoning about nesting and correctness.
Auto-gradedstacksalgorithmsdata-structuresTests the ability to optimize subarray sum queries using prefix sums and monotonic deque when values can be negative.
Auto-gradedprefix-sumsmonotonic-dequesliding-windowarrayTests ability to evaluate a string expression containing non-negative integers, +, -, *, / operators, and parentheses using a stack-based approach.
Auto-gradedstacksexpression evaluationparsingTests the ability to use a monotonic stack to efficiently find, for each day, how many days until a strictly warmer temperature is recorded.
Auto-gradedstackmonotonic stackarrayTests queue simulation by modeling a shared printer that interleaves multi-page jobs across rounds, returning the final page-output order.
Auto-gradedqueuesimulationarraysTests ability to compute positional diffs between consecutive call stack snapshots and emit correctly ordered START/END events using a stack-based mental model.
Auto-gradedstacksimulationstring manipulationTests queue simulation skills by modeling vehicles routing through toll lanes with dynamic overflow and lane-closing logic.
Auto-gradedqueuesimulationgreedyTests bracket matching using a stack to enforce context-sensitive nesting rules across four distinct bracket types with extra validity constraints.
Auto-gradedstacksbracket matchingparsingsimulationTests the ability to apply a monotonic stack to find the largest rectangular area under a histogram while skipping columns that are marked as forbidden.
Auto-gradedmonotonic stackarraysgeometryTests bracket matching logic by verifying that a simplified markup string with typed opening/closing tags is correctly nested and properly closed.
Auto-gradedstackparsingsimulationTests bracket matching by parsing a string of typed scope-open/close tokens and verifying correct nesting, ordering, and balance according to a precedence table.
Auto-gradedstacksbracket matchingparsingsimulationTests the ability to use a monotonic stack to efficiently find, for each building in a skyline, the index of the nearest building to its left that is strictly taller.
Auto-gradedmonotonic stackarraysstackTests ability to use a monotonic stack to compute, for each building, how many previous buildings it "blocks" and find the building that maximally reduces the visible skyline count.
Auto-gradedmonotonic stackarrayssimulationTests whether a candidate can use a stack to correctly evaluate a postfix arithmetic expression involving integers and the four basic operators.
Auto-gradedstacksexpression evaluationsimulationTests queue simulation by processing print jobs where higher-priority jobs preempt lower-priority ones, requiring candidates to track position and reorder the queue correctly.
Auto-gradedqueuesimulationgreedyTests bracket matching with complex rules: typed pairs, mandatory ordered sub-structure inside scopes, and precedence-aware nesting constraints.
Auto-gradedstacksbracket matchingparsingsimulationTests the ability to simulate a round-robin service queue where customers cycle back if unserved, tracking when each customer is finally served.
Auto-gradedqueuesimulationdata structures