Talentd
FleetCode
Make and follow sheets.Sign in

Binary Search Problems (357)

Problems tagged with Binary Search. Start with the easy ones, then move to medium and hard.

32 Easy189 Medium136 Hard

Learn these first

1
Array

Most Binary Search problems operate on sorted arrays. Understanding indexing, traversal, and array manipulation helps you reason about search boundaries and edge cases.

2
Sorting

Binary Search requires sorted data. Knowing common sorting techniques and when data becomes ordered helps you recognize when Binary Search can be applied.

3
Two Pointers

Many interview problems combine Binary Search with two-pointer strategies to optimize searches, detect boundaries, or process sorted ranges efficiently.

4
Binary Search Tree

Binary Search Trees apply the same ordering principle as Binary Search. Understanding BST traversal and structure reinforces how ordered data enables fast lookups.

5
Divide and Conquer

Binary Search is a classic divide-and-conquer algorithm that repeatedly splits the problem space. Learning this paradigm builds intuition for recursive and logarithmic algorithms.

TitleSolutionAcceptDifficultyTopics
Solution73.1%Medium
Array, Binary Search +1· 1 company
704. Binary SearchVideo
Solution61.2%Easy
Array, Binary Search· 11 companies
Solution35.4%Hard
Array, Binary Search +4· 3 companies
Solution54.8%Medium
Array, Binary Search +2· 20 companies
729. My Calendar IVideo
Solution58.4%Medium
Array, Binary Search +3· 12 companies
731. My Calendar IIVideo
Solution63.3%Medium
Array, Binary Search +4· 3 companies
732. My Calendar IIIVideo
Solution72.4%Hard
Binary Search, Design +3· 1 company
754. Reach a NumberVideo
Solution45.5%Medium
Binary Search, Math· 8 companies
Solution53.9%Hard
Array, Binary Search· 2 companies
Solution68.3%Hard
Array, Binary Search +5· 8 companies
Solution69.0%Medium
Array, Binary Search +3· 1 company
Solution50.8%Medium
Array, Binary Search +5· 9 companies
Solution49.9%Medium
Array, Binary Search +2· 3 companies
Solution56.4%Medium
Array, Binary Search +3· 5 companies
Solution66.9%Medium
Array, Binary Search· 10 companies
Solution50.4%Medium
Array, Binary Search· 47 companies
Solution37.1%Hard
Binary Search, Math· 3 companies
887. Super Egg DropVideo
Solution30.6%Hard
888. Fair Candy SwapVideo
Solution65.9%Easy
Array, Binary Search +2· 6 companies
911. Online ElectionVideo
Solution52.8%Medium
Array, Binary Search +2· 3 companies
Solution49.8%Medium
Binary Search, Design +2· 34 companies
Solution68.6%Medium
Array, Binary Search +2· 20 companies
Solution49.9%Medium
Array, Binary Search +2· 6 companies
1055. Shortest Way to Form StringVideoPremium
Solution61.6%Medium
Binary Search, Greedy +2· 3 companies
Solution59.7%Medium
Array, Binary Search· 4 companies
1062. Longest Repeating SubstringVideoPremium
Solution63.4%Medium
1064. Fixed PointVideoPremium
Solution64.1%Easy
Array, Binary Search· 1 company
Solution41.9%Hard
Array, Binary Search +1· 6 companies
1099. Two Sum Less Than KVideoPremium
Solution61.9%Easy
Array, Binary Search +2· 1 company
Solution54.6%Medium
Array, Binary Search +5· 3 companies
1146. Snapshot ArrayVideo
Solution36.8%Medium
Array, Binary Search +2· 20 companies
Solution56.5%Medium
Array, Binary Search +1· 1 company
Solution76.5%Medium
Array, Binary Search +3· 2 companies
1201. Ugly Number IIIVideo
Solution31.9%Medium
Binary Search, Combinatorics +2· 3 companies
Solution80.2%Easy
Array, Binary Search +2· 2 companies
1214. Two Sum BSTsVideoPremium
Solution68.2%Medium
1231. Divide ChocolateVideoPremium
Solution60.5%Hard
Array, Binary Search· 1 company
Showing 51–100 of 357

More about Binary Search

Binary Search is one of the most important algorithms in Data Structures and Algorithms (DSA). It efficiently finds a target value in a sorted collection by repeatedly dividing the search space in half. Instead of scanning every element like linear search, Binary Search reduces the problem size each step, achieving an optimal time complexity of O(log n). This dramatic improvement makes it a core technique for solving large-scale search and optimization problems.

Binary Search is a staple in technical interviews at companies like Google, Amazon, and Meta because it demonstrates a candidate’s ability to reason about sorted data, boundaries, and algorithmic efficiency. Many interview questions extend the classic idea into variations such as finding the first or last occurrence, searching in rotated arrays, or determining minimum feasible values in optimization problems. A strong understanding of Binary Search often overlaps with concepts from Array, Sorting, and Divide and Conquer.

Beyond the standard implementation, modern interview problems frequently use Binary Search as a problem-solving pattern. Instead of searching for an element, you may search for an answer. This technique—often called Binary Search on the answer—is common in scheduling, capacity planning, and optimization problems. In other cases, Binary Search works alongside patterns such as Two Pointers or tree-based structures like Binary Search Tree to solve more complex challenges.

On FleetCode, you can practice that cover beginner fundamentals, classic interview questions, and advanced patterns used in competitive programming. By mastering boundary conditions, mid-point calculations, and different Binary Search templates, you’ll develop the intuition needed to recognize when this powerful technique applies.

If you're preparing for coding interviews, improving algorithmic thinking, or strengthening your DSA foundation, Binary Search is a must-know tool that unlocks faster and more elegant solutions.

Binary Search: common questions

What is the best way to learn Binary Search?

Start with the basic template for searching a sorted array, then practice variations such as lower bound, upper bound, and first/last occurrence. After that, move to advanced patterns like rotated arrays and binary search on the answer.

What are common Binary Search patterns in DSA?

Key patterns include classic element search, lower and upper bounds, searching in rotated arrays, finding peaks or minimums, and binary search on the answer for optimization problems. Each pattern relies on maintaining correct left and right boundaries while shrinking the search space.

Is Binary Search important for FAANG interviews?

Yes. Binary Search is one of the most frequently tested algorithmic techniques in FAANG-style interviews. It appears directly in search problems and indirectly in optimization questions that require logarithmic decision searching.

Why does Binary Search have O(log n) time complexity?

Binary Search cuts the search space in half during every iteration. Because the remaining elements shrink exponentially, it only takes about log2(n) steps to reach the answer, making it far more efficient than linear scanning for large datasets.

What are the best Binary Search problems for coding interviews?

The most common interview problems include search in a sorted array, first and last position of an element, search in rotated sorted array, peak element, and capacity or scheduling optimization problems using binary search on the answer.