Intermediate Binary Search Problems for Coding Interviews
12 intermediate Binary Search problems from real coding interviews, each with test cases you can run online. By difficulty they split into 0 basic, 12 intermediate and 0 advanced. The companies that ask them most often are Amazon, Bloomberg, Google, Meta.
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
- Binary Search Boundary (Intermediate)
- BST Successor and Predecessor (Intermediate)
- Validate Binary Search Tree (Intermediate)
- Kth Smallest Value in a BST (Intermediate)
- Mode Values in a BST (Intermediate)
- Trim a BST (Intermediate)
- Delete Node in a BST (Intermediate)
- Recover Swapped BST Values (Intermediate)
- BST From Preorder (Intermediate)
- Search in Rotated Sorted Array II (Intermediate)
- Balance a Binary Search Tree (Intermediate)
- Binary Insertion Sort Comparison Count (Intermediate)
Related
Frequently asked questions
How do I get good at binary search 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 binary search 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.