Advanced Two Pointers Problems for Coding Interviews
15 advanced Two Pointers problems from real coding interviews, each with test cases you can run online. By difficulty they split into 0 basic, 0 intermediate and 15 advanced. The companies that ask them most often are Google, Microsoft, Accenture, Amazon.
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
- Palindrome Partitioning Min Cuts (Advanced)
- Palindrome Partitioning Min Cuts (Advanced)
- Shortest Palindrome (Advanced)
- Count Distinct Palindromic Subsequences (Advanced)
- Palindrome Pairs Count (Advanced)
- Manacher Palindrome Radii (Advanced)
- Count Proper K-Colorings (Advanced)
- Palindrome Removal (Advanced)
- Ways to Build Sturdy Brick Wall (Advanced)
- Count Palindromic Subsequences of Length 5 (Advanced)
- Longest Chunked Palindrome Decomposition (Advanced)
- Longest Awesome Substring (Advanced)
- Count Palindromic Rearrangements (Advanced)
- Chromatic Number of Small Graph (Advanced)
- Perfect Shuffle Cycle Length (Advanced)
Related
Frequently asked questions
How do I get good at two pointers 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 two pointers 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.