Learn how to find the next greater node in a linked list using a monotonic stack in O(n) time. A popular interview question at Amazon and Adobe that tests your stack intuition and linked list traversal skills.
Master LeetCode 85 — Maximal Rectangle by building on LC 84 Largest Rectangle in Histogram. Learn the row-as-histogram insight, a visual row-by-row dry run, common pitfalls, and clean Python + JavaScript solutions that interviewers love.
LeetCode 32 is one of the most deceptive Hard problems on the platform — the brute-force is obvious, but all three optimal solutions require genuinely different mental models. Master the index-sentinel stack, the DP recurrence, and the two-pass counter sweep, and you will be able to answer any follow-up a FAANG interviewer throws at you.
LC 445 Add Two Numbers II is a medium interview problem at Amazon and Google where numbers are stored most-significant-digit first, requiring stacks or list reversal to process from LSB. Learn the optimal stack-based solution with Python and JavaScript, dry run, and the key difference from LC 2.
LC 430 Flatten a Multilevel Doubly Linked List is a medium interview problem at Microsoft and Amazon that uses DFS or an explicit stack to inline child sub-lists into the main list. Learn the iterative stack approach and the recursive approach with Python and JavaScript, step-by-step dry run, and interview tips.
Master the Valid Parentheses problem using a stack to match nested brackets in O(n) time. The canonical LIFO warm-up problem asked at Google, Meta, Amazon, and Microsoft — learn the hash-map trick and every edge case.
Implement a LIFO stack using only queue operations. Learn both the single-queue rotation trick and the two-queue approach — a classic data-structure design problem that tests your understanding of LIFO vs FIFO at FAANG interviews.
Implement a FIFO queue using two stacks with amortized O(1) push and pop. The two-stack lazy-transfer trick is a FAANG interview staple that demonstrates deep understanding of amortized complexity and LIFO vs FIFO semantics.
Design a stack that supports push, pop, top, and getMin in O(1) time using a parallel min-tracking stack. A classic FAANG design interview problem testing stack invariants and auxiliary state maintenance.
Simulate a baseball scoring game using a stack to handle score records, doubles, sum operations, and cancellations in O(n) time. A clean stack-simulation problem that tests your ability to model stateful operations with LIFO access.
Compare two typed strings after applying backspace characters using a stack simulation or O(1) space two-pointer from the right. Covers both approaches with full complexity analysis and FAANG interview tips.
Find the minimum operations to return to the root folder by simulating file system navigation with a stack depth counter in O(n) time and O(1) space. A clean warm-up problem testing stack simulation and boundary conditions.
Remove adjacent pairs of same letters with different cases using a stack that processes each character and cancels bad pairs immediately. A clean application of the stack-based adjacent-pair-removal pattern common in FAANG string interviews.
Decode a run-length encoded string with nested brackets like 3[a2[bc]] using two stacks for counts and partial strings. A key FAANG problem testing nested structure parsing with stacks — the same pattern used in expression evaluators and compilers.
Evaluate a Reverse Polish Notation expression by pushing operands and applying operators to the top two stack elements in O(n) time. The canonical stack-based expression evaluation problem asked at Amazon, LinkedIn, and Microsoft.
Simulate asteroid collisions where right-moving asteroids accumulate on the stack and left-moving ones destroy smaller ones on collision. A clean application of the collision-simulation stack pattern asked at Amazon and Bloomberg.
Calculate the score of a balanced parentheses string where () = 1 and (A) = 2*A using a stack and an elegant O(1) space depth-doubling trick. A FAANG medium problem that rewards deep thinking with a beautiful bit-shift optimization.
Solve LeetCode 227 Basic Calculator II using a stack to handle operator precedence for plus, minus, multiplication, and division. A FAANG interview classic at Google, Amazon, Meta, and Uber.
Solve LeetCode 456 132 Pattern in O(n) using a monotonic stack scanned from right to left while tracking the best second-largest. A FAANG interview favorite at Bloomberg, Amazon, and Google.
Solve LeetCode 1944 Number of Visible People in a Queue in O(n) using a monotonic decreasing stack. A FAANG hard interview problem at Amazon, Google, and Meta that uses LIFO stack semantics for visibility queries.
Solve LeetCode 341 Flatten Nested List Iterator with a lazy stack-based approach in O(1) amortized hasNext and next. A FAANG design favorite at Google, Meta, and Amazon.
Solve LeetCode 1209 Remove All Adjacent Duplicates II in O(n) using a counter stack of (char, count) pairs. A FAANG-favorite stack twist asked at Google and Amazon.
Solve LeetCode 84 Largest Rectangle in Histogram in O(n) using a monotonic increasing stack. The single most important monotonic stack interview problem at FAANG.
Solve LeetCode 224 Basic Calculator with a single-pass stack approach handling +, -, parentheses, and arbitrary whitespace in O(n). A FAANG hard parsing classic.