Top Stack LeetCode Questions Asked in Microsoft Interviews
Stack is an important data structure frequently tested in Microsoft software engineering interviews. Many problems involve concepts like monotonic stack, expression evaluation, next greater element, and parsing problems, which require a solid understanding of stack operations.
In this guide, we have compiled commonly asked stack-based LeetCode problems reported in Microsoft interviews. These questions will help you understand important patterns used to solve problems efficiently using stacks.
Practicing these problems will improve your ability to handle complex problem-solving scenarios, especially those involving nested structures, ordering constraints, and optimization.
Below is the curated list of stack-related LeetCode questions asked in Microsoft interviews.
| Sl.No | Question | Difficulty | Frequency | LeetCode Link |
|---|
| 1 | Trapping Rain Water | HARD | 85.90% | Solve |
| 2 | Valid Parentheses | EASY | 77.70% | Solve |
| 3 | Largest Rectangle in Histogram | HARD | 61.50% | Solve |
| 4 | Longest Valid Parentheses | HARD | 48.70% | Solve |
| 5 | Simplify Path | MEDIUM | 45.30% | Solve |
| 6 | Min Stack | MEDIUM | 37.90% | Solve |
| 7 | Maximum Frequency Stack | HARD | 37.90% | Solve |
| 8 | Binary Tree Inorder Traversal | EASY | 37.60% | Solve |
| 9 | Flatten Binary Tree to Linked List | MEDIUM | 37.40% | Solve |
| 10 | Maximal Rectangle | HARD | 36.10% | Solve |
| 11 | Implement Stack using Queues | EASY | 33.20% | Solve |
| 12 | Basic Calculator II | MEDIUM | 30.60% | Solve |
| 13 | Flatten Nested List Iterator | MEDIUM | 2.75% | Solve |
| 14 | Basic Calculator | HARD | 2.62% | Solve |
| 15 | Basic Calculator III | HARD | 2.56% | Solve |
| 16 | Binary Search Tree Iterator | MEDIUM | 2.19% | Solve |
| 17 | Add Two Numbers II | MEDIUM | 2.17% | Solve |
| 18 | Reorder List | MEDIUM | 2.15% | Solve |
| 19 | Palindrome Linked List | EASY | 2.13% | Solve |
| 20 | Decode String | MEDIUM | 2.07% | Solve |
| 21 | Evaluate Reverse Polish Notation | MEDIUM | 1.90% | Solve |
| 22 | Next Greater Element II | MEDIUM | 1.77% | Solve |
| 23 | Next Greater Element I | EASY | 1.62% | Solve |
| 24 | Daily Temperatures | MEDIUM | 1.62% | Solve |
| 25 | Max Stack | EASY | 1.60% | Solve |
| 26 | Implement Queue using Stacks | EASY | 1.41% | Solve |
| 27 | Exclusive Time of Functions | MEDIUM | 1.34% | Solve |
| 28 | Tag Validator | HARD | 1.13% | Solve |
| 29 | Remove Duplicate Letters | HARD | 0.84% | Solve |
| 30 | Remove K Digits | MEDIUM | 0.80% | Solve |
| 31 | Asteroid Collision | MEDIUM | 0.72% | Solve |
| 32 | Online Stock Span | MEDIUM | 0.65% | Solve |
| 33 | Backspace String Compare | EASY | 0.47% | Solve |
| 34 | Next Greater Node In Linked List | MEDIUM | 0.44% | Solve |
| 35 | Max Chunks To Make Sorted II | HARD | 0.23% | Solve |
| 36 | Minimum Remove to Make Valid Parentheses | MEDIUM | 0.21% | Solve |
| 37 | Construct Binary Search Tree from Preorder Traversal | MEDIUM | 0.21% | Solve |
| 38 | Design a Stack With Increment Operation | MEDIUM | 0.15% | Solve |
| 39 | Maximum Binary Tree | MEDIUM | 0.12% | Solve |
| 40 | Binary Tree Preorder Traversal | MEDIUM | 0.12% | Solve |
| 41 | Sum of Subarray Minimums | MEDIUM | 0.09% | Solve |
You can also track your progress and practice these questions using our tool:
Microsoft LeetCode Interview Questions Tracker
Related Articles