Pattern · Stack

Stack interview questions

114 stack problems tagged across recent interview reports. Drilled most heavily by meta, google, and amazon.

Founder's read

Stack is the most direct pattern in coding interviews: last-in, first-out data structure that solves problems about order, nesting, and sequence. With 114 problems tagged across the pattern and heavy demand from Meta (42 problems), Google (39), and Amazon (38), you'll almost certainly see a Stack variant in your OA. The pattern appears in expression evaluation, parenthesis matching, monotonic stack tricks, and iterative traversal. If a hard Stack problem lands in your live assessment and you freeze, StealthCoder solves it invisibly in seconds.

Most-asked stack problems

#ProblemDiff# Companies
01Decode StringMEDIUM36
02Basic Calculator IIMEDIUM27
03Daily TemperaturesMEDIUM27
04Largest Rectangle in HistogramHARD26
05Asteroid CollisionMEDIUM24
06Longest Valid ParenthesesHARD21
07Basic CalculatorHARD17
08Evaluate Reverse Polish NotationMEDIUM13
09Backspace String CompareEASY12
10Flatten Nested List IteratorMEDIUM12
11Flatten Binary Tree to Linked ListMEDIUM11
12Basic Calculator IIIHARD10
13Design a Text EditorHARD8
14Binary Tree Inorder TraversalEASY7
15Car FleetMEDIUM6
16Design a Stack With Increment OperationMEDIUM5
17Design Browser HistoryMEDIUM5
18Exclusive Time of FunctionsMEDIUM5
19Implement Queue using StacksEASY5
20Implement Stack using QueuesEASY5
21Crawler Log FolderEASY4
22Binary Search Tree IteratorMEDIUM3
23Make The String GreatEASY3
24132 PatternMEDIUM2
25Basic Calculator IVHARD2
26Binary Tree Preorder TraversalEASY2
27Buildings With an Ocean ViewMEDIUM2
28Closest Binary Search Tree Value IIHARD2
29Construct Smallest Number From DI StringMEDIUM2
30Convert Binary Search Tree to Sorted Doubly Linked ListMEDIUM2
31Create Maximum NumberHARD2
32Decoded String at IndexMEDIUM2
33Add Two Numbers IIMEDIUM1
34Baseball GameEASY1
35Beautiful Towers IMEDIUM1
36Beautiful Towers IIMEDIUM1
37Binary Tree Postorder TraversalEASY1
38Build Binary Expression Tree From Infix ExpressionHARD1
39Check if a Parentheses String Can Be ValidMEDIUM1
40Check If Word Is Valid After SubstitutionsMEDIUM1
41Clear DigitsEASY1
42Construct Binary Search Tree from Preorder TraversalMEDIUM1
43Count Collisions on a RoadMEDIUM1
44Double a Number Represented as a Linked ListMEDIUM1
45Final Prices With a Special Discount in a ShopEASY1
46Find Building Where Alice and Bob Can MeetHARD1
47Find Mirror Score of a StringMEDIUM1
48Lexicographically Minimum String After Removing StarsMEDIUM1
49Longest Well-Performing IntervalMEDIUM1
50Max Chunks To Make SortedMEDIUM1

Showing top 50 of 114 stack problems by # companies asking.

The hedge for the live OA

You can't drill every stack variant before the assessment. StealthCoder runs invisibly during screen share and solves whichever variant they throw at you. No browser extension. No detection signature. Made by a working FAANG engineer who treats the OA the way companies treat hiring: as a game with rules you should know.

Get StealthCoder
What this means

Stack problems fall into clear buckets: parsing and calculation (Basic Calculator, Basic Calculator II), bracket/parenthesis validation, collision simulation (Asteroid Collision), and monotonic stack optimization for finding next/previous elements. Recognition is usually immediate, you'll see a problem explicitly requiring LIFO order or nested structures, but the implementation trap is depth. Monotonic stack variants and calculator chains take real time to code correctly under pressure. The drill order matters: start with bracket matching and simple evaluation, move into collision and comparison problems, then hit monotonic stack hard. Bloomberg and Goldman Sachs both ask monotonic stack heavily. This is where StealthCoder becomes your hedge: a tricky variant you didn't anticipate lands, the clock is ticking, and you need a working solution immediately.

Companies that hire most on stack

The honest play

114 stack problems. You won't drill them all. Pass anyway.

Stack is one of the patterns interviews actually filter on. Memorizing every variant in a week is a fantasy. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds, no matter which stack flavor lands in your live OA. Made by a working FAANG engineer who treats the OA the way companies treat hiring: as a game with rules you should know. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Stack interview FAQ

How many Stack problems should I drill before my OA?+

With 114 problems in this pattern, you won't drill them all. Target 20-30: 5-6 on bracket matching and validation, 8-10 on basic calculators and expression parsing, 5-6 on monotonic stack, and 5-6 on collision or comparison. Hit Meta and Google's most-asked variants first.

Is Stack the most important pattern for tech interviews?+

It's not the most frequent, but it's high-signal. Meta, Google, Amazon, and LinkedIn all ask it heavily. It's also a tell: if you fumble Stack, you fumble system design later. Drill it seriously.

How do I recognize a Stack problem in an OA?+

Look for explicit LIFO order, nested structures (parentheses, brackets), expression parsing, or finding 'previous greater/smaller' elements. If you see collision, asteroid, or backspace logic, Stack is likely the right tool. Monotonic stack is trickier, harder to spot but cleaner than brute force.

Which company drills Stack the hardest?+

Meta has the highest problem count at 42, followed closely by Google (39) and Amazon (38). Bloomberg and Goldman Sachs lean heavily on monotonic stack variants. If you're targeting Meta, Stack is non-negotiable.

What's the trickiest Stack variant I should prepare for?+

Monotonic stack and calculator chains are the hardest. Monotonic stack looks simple but requires careful logic and indexing; calculators need clean parsing and operator precedence handling. Both are time-killers in a live OA. Drill Beautiful Towers and all four Basic Calculator levels.

Problem and frequency data sourced from public community-maintained interview-report repos. Problems and trademarks © LeetCode.