Intermediate Stack Problems for Coding Interviews
20 intermediate Stack problems from real coding interviews, each with test cases you can run online. By difficulty they split into 0 basic, 20 intermediate and 0 advanced. The companies that ask them most often are Amazon, Google, Meta, Bloomberg.
Solve a few problems of each level, name the pattern after each one and revisit the ones that needed a hint a week later. Practise stating the time and space complexity and the edge cases before you code.
Coding problems
- Score of Parentheses (Intermediate)
- Remove Invalid Parentheses (Intermediate)
- Stack With Middle Operations (Intermediate)
- Glob File Matcher (Intermediate)
- Expression AST Simplifier (Intermediate)
- Symbolic Differentiation (Intermediate)
- Basic Calculator II (Intermediate)
- Validate Stack Sequences (Intermediate)
- Exclusive Time of Functions (Intermediate)
- Reverse Substrings Between Parentheses (Intermediate)
- Fraction to Recurring Decimal (Intermediate)
- Merge Equal Adjacent Nodes (Intermediate)
- Construct Maximum Binary Tree (Intermediate)
- Minimum Insertions to Balance Parentheses (Intermediate)
- Parentheses String Can Be Valid (Intermediate)
- Stack With Increment Operation (Intermediate)
- Minimum Swaps to Make the String Balanced (Intermediate)
- Stack Sortable Permutation Check (Intermediate)
- Progressive Tax Total (Intermediate)
- Stack Machine Final Top (Intermediate)
Related
Frequently asked questions
How do I get good at stack problems?
Practise by level, name the pattern after you solve each problem and review the ones you needed hints for. The list is ordered so you can start with the basic ones.
Can I run stack problems online here?
Yes. Each problem opens in an editor that runs your code against test cases in Java, Python, C++, Go, JavaScript and more.