Key Patterns to Master
- LIFO Logic: For nesting and reversals.
- Monotonic Stack: For nearest greater/smaller element problems.
- Monotonic Queue: For finding max/min in sliding windows.
Hand-Picked Problems
| Problem | Difficulty | Key Pattern |
|---|---|---|
| Valid Parentheses | Easy | Basic Stack |
| Implement Stack using Queues | Easy | Structure Logic |
| Next Greater Element I | Easy | Monotonic Stack |
| Daily Temperatures | Medium | Stack Distance |
| Min Stack | Medium | Multiple Stacks |
| Simplify Path | Medium | String Parsing |
| Largest Rectangle in Histogram | Hard | Monotonic Boundaries |
| Trapping Rain Water | Hard | Stack vs Two Pointers |
| Sliding Window Maximum | Hard | Monotonic Queue |
| Basic Calculator II | Medium | Expression Eval |
Interview Tip
Always mention the LIFO or FIFO property when justifying your choice of data structure.