# Binary Search DSA Problems

> 298 Binary Search coding problems for placements and interviews, sorted easiest first, with hints and company tags. Free practice on InternHack.

Canonical: https://www.internhack.in/learn/dsa/binary-search
Last updated: 2026-11-28

298 binary search problems for coding interviews and campus placements, with hints and company tags. Below are the first 100 of 298: 31 easy, 0 medium and 69 hard. Practise them free on InternHack and track what you have solved.

## Binary Search problems, easiest first

1. [Arranging Coins](https://www.internhack.in/learn/dsa/problem/arranging-coins) (Easy)
2. [Binary Search](https://www.internhack.in/learn/dsa/problem/binary-search) (Easy)
3. [Check If a Number Is Majority Element in a Sorted Array](https://www.internhack.in/learn/dsa/problem/check-if-a-number-is-majority-element-in-a-sorted-array) (Easy)
4. [Check If N and Its Double Exist](https://www.internhack.in/learn/dsa/problem/check-if-n-and-its-double-exist) (Easy)
5. [Closest Binary Search Tree Value](https://www.internhack.in/learn/dsa/problem/closest-binary-search-tree-value) (Easy)
6. [Count Complete Tree Nodes](https://www.internhack.in/learn/dsa/problem/count-complete-tree-nodes) (Easy)
7. [Count Negative Numbers in a Sorted Matrix](https://www.internhack.in/learn/dsa/problem/count-negative-numbers-in-a-sorted-matrix) (Easy)
8. [Count Pairs Whose Sum is Less than Target](https://www.internhack.in/learn/dsa/problem/count-pairs-whose-sum-is-less-than-target) (Easy)
9. [Count the Number of Incremovable Subarrays I](https://www.internhack.in/learn/dsa/problem/count-the-number-of-incremovable-subarrays-i) (Easy)
10. [Fair Candy Swap](https://www.internhack.in/learn/dsa/problem/fair-candy-swap) (Easy)
11. [Find Smallest Letter Greater Than Target](https://www.internhack.in/learn/dsa/problem/find-smallest-letter-greater-than-target) (Easy)
12. [Find Target Indices After Sorting Array](https://www.internhack.in/learn/dsa/problem/find-target-indices-after-sorting-array) (Easy)
13. [Find the Distance Value Between Two Arrays](https://www.internhack.in/learn/dsa/problem/find-the-distance-value-between-two-arrays) (Easy)
14. [First Bad Version](https://www.internhack.in/learn/dsa/problem/first-bad-version) (Easy)
15. [Fixed Point](https://www.internhack.in/learn/dsa/problem/fixed-point) (Easy)
16. [Fruits Into Baskets II](https://www.internhack.in/learn/dsa/problem/fruits-into-baskets-ii) (Easy)
17. [Guess Number Higher or Lower](https://www.internhack.in/learn/dsa/problem/guess-number-higher-or-lower) (Easy)
18. [Intersection of Three Sorted Arrays](https://www.internhack.in/learn/dsa/problem/intersection-of-three-sorted-arrays) (Easy)
19. [Intersection of Two Arrays](https://www.internhack.in/learn/dsa/problem/intersection-of-two-arrays) (Easy)
20. [Intersection of Two Arrays II](https://www.internhack.in/learn/dsa/problem/intersection-of-two-arrays-ii) (Easy)
21. [Kth Missing Positive Number](https://www.internhack.in/learn/dsa/problem/kth-missing-positive-number) (Easy)
22. [Longest Subsequence With Limited Sum](https://www.internhack.in/learn/dsa/problem/longest-subsequence-with-limited-sum) (Easy)
23. [Maximum Count of Positive Integer and Negative Integer](https://www.internhack.in/learn/dsa/problem/maximum-count-of-positive-integer-and-negative-integer) (Easy)
24. [Minimum Common Value](https://www.internhack.in/learn/dsa/problem/minimum-common-value) (Easy)
25. [Missing Number](https://www.internhack.in/learn/dsa/problem/missing-number) (Easy)
26. [Search Insert Position](https://www.internhack.in/learn/dsa/problem/search-insert-position) (Easy)
27. [Special Array With X Elements Greater Than or Equal X](https://www.internhack.in/learn/dsa/problem/special-array-with-x-elements-greater-than-or-equal-x) (Easy)
28. [Sqrt(x)](https://www.internhack.in/learn/dsa/problem/sqrtx) (Easy)
29. [The K Weakest Rows in a Matrix](https://www.internhack.in/learn/dsa/problem/the-k-weakest-rows-in-a-matrix) (Easy)
30. [Two Sum Less Than K](https://www.internhack.in/learn/dsa/problem/two-sum-less-than-k) (Easy)
31. [Valid Perfect Square](https://www.internhack.in/learn/dsa/problem/valid-perfect-square) (Easy)
32. [Apply Operations to Maximize Frequency Score](https://www.internhack.in/learn/dsa/problem/apply-operations-to-maximize-frequency-score) (Hard)
33. [Block Placement Queries](https://www.internhack.in/learn/dsa/problem/block-placement-queries) (Hard)
34. [Booking Concert Tickets in Groups](https://www.internhack.in/learn/dsa/problem/booking-concert-tickets-in-groups) (Hard)
35. [Closest Room](https://www.internhack.in/learn/dsa/problem/closest-room) (Hard)
36. [Count Good Triplets in an Array](https://www.internhack.in/learn/dsa/problem/count-good-triplets-in-an-array) (Hard)
37. [Count of Range Sum](https://www.internhack.in/learn/dsa/problem/count-of-range-sum) (Hard)
38. [Count of Smaller Numbers After Self](https://www.internhack.in/learn/dsa/problem/count-of-smaller-numbers-after-self) (Hard)
39. [Count Pairs Of Nodes](https://www.internhack.in/learn/dsa/problem/count-pairs-of-nodes) (Hard)
40. [Count Subarrays With Score Less Than K](https://www.internhack.in/learn/dsa/problem/count-subarrays-with-score-less-than-k) (Hard)
41. [Count the Number of Incremovable Subarrays II](https://www.internhack.in/learn/dsa/problem/count-the-number-of-incremovable-subarrays-ii) (Hard)
42. [Count the Number of K-Big Indices](https://www.internhack.in/learn/dsa/problem/count-the-number-of-k-big-indices) (Hard)
43. [Create Sorted Array through Instructions](https://www.internhack.in/learn/dsa/problem/create-sorted-array-through-instructions) (Hard)
44. [Data Stream as Disjoint Intervals](https://www.internhack.in/learn/dsa/problem/data-stream-as-disjoint-intervals) (Hard)
45. [Design an Array Statistics Tracker](https://www.internhack.in/learn/dsa/problem/design-an-array-statistics-tracker) (Hard)
46. [Divide Chocolate](https://www.internhack.in/learn/dsa/problem/divide-chocolate) (Hard)
47. [Earliest Second to Mark Indices II](https://www.internhack.in/learn/dsa/problem/earliest-second-to-mark-indices-ii) (Hard)
48. [Escape the Spreading Fire](https://www.internhack.in/learn/dsa/problem/escape-the-spreading-fire) (Hard)
49. [Find a Value of a Mysterious Function Closest to Target](https://www.internhack.in/learn/dsa/problem/find-a-value-of-a-mysterious-function-closest-to-target) (Hard)
50. [Find Beautiful Indices in the Given Array II](https://www.internhack.in/learn/dsa/problem/find-beautiful-indices-in-the-given-array-ii) (Hard)
51. [Find Building Where Alice and Bob Can Meet](https://www.internhack.in/learn/dsa/problem/find-building-where-alice-and-bob-can-meet) (Hard)
52. [Find in Mountain Array](https://www.internhack.in/learn/dsa/problem/find-in-mountain-array) (Hard)
53. [Find K-th Smallest Pair Distance](https://www.internhack.in/learn/dsa/problem/find-k-th-smallest-pair-distance) (Hard)
54. [Find Maximum Non-decreasing Array Length](https://www.internhack.in/learn/dsa/problem/find-maximum-non-decreasing-array-length) (Hard)
55. [Find Minimum in Rotated Sorted Array II](https://www.internhack.in/learn/dsa/problem/find-minimum-in-rotated-sorted-array-ii) (Hard)
56. [Find Products of Elements of Big Array](https://www.internhack.in/learn/dsa/problem/find-products-of-elements-of-big-array) (Hard)
57. [Find Subarray With Bitwise OR Closest to K](https://www.internhack.in/learn/dsa/problem/find-subarray-with-bitwise-or-closest-to-k) (Hard)
58. [Find the Kth Smallest Sum of a Matrix With Sorted Rows](https://www.internhack.in/learn/dsa/problem/find-the-kth-smallest-sum-of-a-matrix-with-sorted-rows) (Hard)
59. [Find the Longest Valid Obstacle Course at Each Position](https://www.internhack.in/learn/dsa/problem/find-the-longest-valid-obstacle-course-at-each-position) (Hard)
60. [Find the Median of the Uniqueness Array](https://www.internhack.in/learn/dsa/problem/find-the-median-of-the-uniqueness-array) (Hard)
61. [Find the Number of Subarrays Where Boundary Elements Are Maximum](https://www.internhack.in/learn/dsa/problem/find-the-number-of-subarrays-where-boundary-elements-are-maximum) (Hard)
62. [Find Weighted Median Node in Tree](https://www.internhack.in/learn/dsa/problem/find-weighted-median-node-in-tree) (Hard)
63. [Kth Ancestor of a Tree Node](https://www.internhack.in/learn/dsa/problem/kth-ancestor-of-a-tree-node) (Hard)
64. [Kth Smallest Number in Multiplication Table](https://www.internhack.in/learn/dsa/problem/kth-smallest-number-in-multiplication-table) (Hard)
65. [Kth Smallest Product of Two Sorted Arrays](https://www.internhack.in/learn/dsa/problem/kth-smallest-product-of-two-sorted-arrays) (Hard)
66. [Last Day Where You Can Still Cross](https://www.internhack.in/learn/dsa/problem/last-day-where-you-can-still-cross) (Hard)
67. [Longest Common Subpath](https://www.internhack.in/learn/dsa/problem/longest-common-subpath) (Hard)
68. [Longest Duplicate Substring](https://www.internhack.in/learn/dsa/problem/longest-duplicate-substring) (Hard)
69. [Make Array Empty](https://www.internhack.in/learn/dsa/problem/make-array-empty) (Hard)
70. [Max Sum of Rectangle No Larger Than K](https://www.internhack.in/learn/dsa/problem/max-sum-of-rectangle-no-larger-than-k) (Hard)
71. [Maximize the Minimum Game Score](https://www.internhack.in/learn/dsa/problem/maximize-the-minimum-game-score) (Hard)
72. [Maximize the Minimum Powered City](https://www.internhack.in/learn/dsa/problem/maximize-the-minimum-powered-city) (Hard)
73. [Maximum Average Subarray II](https://www.internhack.in/learn/dsa/problem/maximum-average-subarray-ii) (Hard)
74. [Maximum Balanced Subsequence Sum](https://www.internhack.in/learn/dsa/problem/maximum-balanced-subsequence-sum) (Hard)
75. [Maximum Frequency of an Element After Performing Operations II](https://www.internhack.in/learn/dsa/problem/maximum-frequency-of-an-element-after-performing-operations-ii) (Hard)
76. [Maximum Fruits Harvested After at Most K Steps](https://www.internhack.in/learn/dsa/problem/maximum-fruits-harvested-after-at-most-k-steps) (Hard)
77. [Maximum GCD-Sum of a Subarray](https://www.internhack.in/learn/dsa/problem/maximum-gcd-sum-of-a-subarray) (Hard)
78. [Maximum Number of Events That Can Be Attended II](https://www.internhack.in/learn/dsa/problem/maximum-number-of-events-that-can-be-attended-ii) (Hard)
79. [Maximum Number of Groups With Increasing Length](https://www.internhack.in/learn/dsa/problem/maximum-number-of-groups-with-increasing-length) (Hard)
80. [Maximum Number of Robots Within Budget](https://www.internhack.in/learn/dsa/problem/maximum-number-of-robots-within-budget) (Hard)
81. [Maximum Number of Tasks You Can Assign](https://www.internhack.in/learn/dsa/problem/maximum-number-of-tasks-you-can-assign) (Hard)
82. [Maximum Partition Factor](https://www.internhack.in/learn/dsa/problem/maximum-partition-factor) (Hard)
83. [Maximum Profit in Job Scheduling](https://www.internhack.in/learn/dsa/problem/maximum-profit-in-job-scheduling) (Hard)
84. [Maximum Running Time of N Computers](https://www.internhack.in/learn/dsa/problem/maximum-running-time-of-n-computers) (Hard)
85. [Maximum Score of a Good Subarray](https://www.internhack.in/learn/dsa/problem/maximum-score-of-a-good-subarray) (Hard)
86. [Maximum Score of Non-overlapping Intervals](https://www.internhack.in/learn/dsa/problem/maximum-score-of-non-overlapping-intervals) (Hard)
87. [Maximum Total Beauty of the Gardens](https://www.internhack.in/learn/dsa/problem/maximum-total-beauty-of-the-gardens) (Hard)
88. [Maximum Walls Destroyed by Robots](https://www.internhack.in/learn/dsa/problem/maximum-walls-destroyed-by-robots) (Hard)
89. [Median of Two Sorted Arrays](https://www.internhack.in/learn/dsa/problem/median-of-two-sorted-arrays) (Hard)
90. [Minimize Max Distance to Gas Station](https://www.internhack.in/learn/dsa/problem/minimize-max-distance-to-gas-station) (Hard)
91. [Minimize the Maximum Adjacent Element Difference](https://www.internhack.in/learn/dsa/problem/minimize-the-maximum-adjacent-element-difference) (Hard)
92. [Minimum Cost to Make Array Equal](https://www.internhack.in/learn/dsa/problem/minimum-cost-to-make-array-equal) (Hard)
93. [Minimum Interval to Include Each Query](https://www.internhack.in/learn/dsa/problem/minimum-interval-to-include-each-query) (Hard)
94. [Minimum Number of Operations to Make Array Continuous](https://www.internhack.in/learn/dsa/problem/minimum-number-of-operations-to-make-array-continuous) (Hard)
95. [Minimum Number of Removals to Make Mountain Array](https://www.internhack.in/learn/dsa/problem/minimum-number-of-removals-to-make-mountain-array) (Hard)
96. [Minimum Operations to Make a Subsequence](https://www.internhack.in/learn/dsa/problem/minimum-operations-to-make-a-subsequence) (Hard)
97. [Minimum Operations to Make Numbers Non-positive](https://www.internhack.in/learn/dsa/problem/minimum-operations-to-make-numbers-non-positive) (Hard)
98. [Minimum Operations to Make the Array K-Increasing](https://www.internhack.in/learn/dsa/problem/minimum-operations-to-make-the-array-k-increasing) (Hard)
99. [Minimum Space Wasted From Packaging](https://www.internhack.in/learn/dsa/problem/minimum-space-wasted-from-packaging) (Hard)
100. [Minimum Stability Factor of Array](https://www.internhack.in/learn/dsa/problem/minimum-stability-factor-of-array) (Hard)

## Companies that ask binary search problems

- [Amazon](https://www.internhack.in/learn/dsa/companies/amazon): 70 of these problems
- [Google](https://www.internhack.in/learn/dsa/companies/google): 68 of these problems
- [Meta](https://www.internhack.in/learn/dsa/companies/meta): 40 of these problems
- [Microsoft](https://www.internhack.in/learn/dsa/companies/microsoft): 40 of these problems
- [Bloomberg](https://www.internhack.in/learn/dsa/companies/bloomberg): 38 of these problems
- [Uber](https://www.internhack.in/learn/dsa/companies/uber): 11 of these problems
- [Apple](https://www.internhack.in/learn/dsa/companies/apple): 10 of these problems
- [Oracle](https://www.internhack.in/learn/dsa/companies/oracle): 10 of these problems
- [Infosys](https://www.internhack.in/learn/dsa/companies/infosys): 9 of these problems
- [TCS](https://www.internhack.in/learn/dsa/companies/tcs): 9 of these problems
- [Adobe](https://www.internhack.in/learn/dsa/companies/adobe): 8 of these problems
- [IBM](https://www.internhack.in/learn/dsa/companies/ibm): 7 of these problems

## Before your interview

Most resumes are filtered by software before a recruiter reads them. [Check your resume ATS score free](https://www.internhack.in/ats-score/try), no signup needed.

## Other DSA topics

- [Array](https://www.internhack.in/learn/dsa/array) (1869)
- [String](https://www.internhack.in/learn/dsa/string) (775)
- [Hash Table](https://www.internhack.in/learn/dsa/hash-table) (708)
- [Math](https://www.internhack.in/learn/dsa/math) (564)
- [Dynamic Programming](https://www.internhack.in/learn/dsa/dynamic-programming) (557)
- [Sorting](https://www.internhack.in/learn/dsa/sorting) (464)
- [Greedy](https://www.internhack.in/learn/dsa/greedy) (407)
- [Depth-First Search](https://www.internhack.in/learn/dsa/depth-first-search) (314)
- [Matrix](https://www.internhack.in/learn/dsa/matrix) (246)
- [Breadth-First Search](https://www.internhack.in/learn/dsa/breadth-first-search) (245)
- [Bit Manipulation](https://www.internhack.in/learn/dsa/bit-manipulation) (238)
- [Tree](https://www.internhack.in/learn/dsa/tree) (235)
- [Two Pointers](https://www.internhack.in/learn/dsa/two-pointers) (217)
- [Prefix Sum](https://www.internhack.in/learn/dsa/prefix-sum) (204)
- [Database](https://www.internhack.in/learn/dsa/database) (197)
- [Heap (Priority Queue)](https://www.internhack.in/learn/dsa/heap-priority-queue) (196)
- [Simulation](https://www.internhack.in/learn/dsa/simulation) (177)
- [Counting](https://www.internhack.in/learn/dsa/counting) (174)
- [Binary Tree](https://www.internhack.in/learn/dsa/binary-tree) (169)
- [Stack](https://www.internhack.in/learn/dsa/stack) (167)

## Related

- [Home](https://www.internhack.in/)
- [Learn](https://www.internhack.in/learn)
- [DSA](https://www.internhack.in/learn/dsa)
