LeetCodechevron_rightCategorieschevron_rightbinary search
search

binary search

265 problems
Easy: 26Medium: 135Hard: 104

binary search is one of the most repeated interview dimensions. Start with edge-safe fundamentals, then move into pattern-level trade-offs.

Interview Signal

Frequently tests problem modeling, edge handling, and verbal clarity.

Common Pitfall

Template-only answers break under follow-up questioning.

Practice Strategy

Practice in 3-5 problem rounds and always review complexity alternatives.

Recommended Progression

Problem bank

binary search problem bank

Start with a compact scan-friendly list and progressively load more so the topic page stays readable even when the corpus is large.

Progressive topic library

Built for large topic sets: scan the structure first, then go deeper.

hourglass_bottomScroll to continue
search
tuneDifficulty

Showing 24 / 265 problems

+24 per load
#TitleDifficulty
4

Median of Two Sorted Arrays

Find the median of two sorted arrays using binary search for efficient O(log(min(m, n))) time complexity.

Hard
33

Search in Rotated Sorted Array

Find the index of a target in a rotated sorted array using a careful binary search that handles pivot shifts.

Medium
34

Find First and Last Position of Element in Sorted Array

Locate the first and last index of a target in a sorted array using binary search for precise O(log n) performance.

Medium
35

Search Insert Position

Find the correct index for a target value in a sorted array using binary search, or return the position where it should …

Easy
69

Sqrt(x)

Solve the Sqrt(x) problem using binary search to find the integer square root of a number without built-in operators.

Easy
74

Search a 2D Matrix

Search a 2D matrix efficiently using binary search over its linearized index, ensuring correctness in row-major sorted a…

Medium
81

Search in Rotated Sorted Array II

Determine if a target exists in a rotated sorted array that may contain duplicates using a binary search variation effic…

Medium
153

Find Minimum in Rotated Sorted Array

Find the minimum element in a rotated sorted array using binary search to efficiently identify the point of rotation.

Medium
154

Find Minimum in Rotated Sorted Array II

Find the minimum in a rotated sorted array with possible duplicates using binary search.

Hard
162

Find Peak Element

Find Peak Element leverages binary search for efficiently locating a peak in an array, a problem commonly asked in techn…

Medium
167

Two Sum II - Input Array Is Sorted

Solve the Two Sum II problem efficiently using binary search over a valid answer space in a sorted array.

Medium
209

Minimum Size Subarray Sum

Find the minimal length of a subarray whose sum is greater than or equal to the target using efficient algorithms.

Medium
222

Count Complete Tree Nodes

Count Complete Tree Nodes efficiently by leveraging binary-tree traversal, exploiting completeness, and applying bit man…

Easy
240

Search a 2D Matrix II

Efficiently search for a target in a 2D matrix using binary search and matrix properties.

Medium
268

Missing Number

Find the missing number in an array containing distinct numbers in the range [0, n].

Easy
275

H-Index II

Compute a researcher's H-Index from a sorted citation array using binary search over the valid answer space efficiently.

Medium
278

First Bad Version

Find the first bad version of a product using binary search, minimizing the number of API calls.

Easy
287

Find the Duplicate Number

The problem involves finding the duplicate number in an array of integers, using a binary search approach over the valid…

Medium
300

Longest Increasing Subsequence

Solve the Longest Increasing Subsequence problem using dynamic programming and binary search to efficiently find the sub…

Medium
315

Count of Smaller Numbers After Self

Solve the Count of Smaller Numbers After Self problem using binary search and optimized algorithms.

Hard
327

Count of Range Sum

Count the number of subarray sums within a given inclusive range using optimized divide-and-conquer techniques efficient…

Hard
349

Intersection of Two Arrays

Find the intersection of two arrays while ensuring unique elements using efficient array scanning and hash lookups.

Easy
350

Intersection of Two Arrays II

Find the intersection of two arrays, accounting for multiple occurrences of the same number.

Easy
352

Data Stream as Disjoint Intervals

The problem involves designing a class to summarize a data stream of non-negative integers as disjoint intervals using b…

Hard

swap_vertScroll inside the bank to auto-load more

Related Patterns

Binary Search LeetCode Problems: 265 Solutions