Binary Search DSA Problems

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 (Easy)
  2. Binary Search (Easy)
  3. Check If a Number Is Majority Element in a Sorted Array (Easy)
  4. Check If N and Its Double Exist (Easy)
  5. Closest Binary Search Tree Value (Easy)
  6. Count Complete Tree Nodes (Easy)
  7. Count Negative Numbers in a Sorted Matrix (Easy)
  8. Count Pairs Whose Sum is Less than Target (Easy)
  9. Count the Number of Incremovable Subarrays I (Easy)
  10. Fair Candy Swap (Easy)
  11. Find Smallest Letter Greater Than Target (Easy)
  12. Find Target Indices After Sorting Array (Easy)
  13. Find the Distance Value Between Two Arrays (Easy)
  14. First Bad Version (Easy)
  15. Fixed Point (Easy)
  16. Fruits Into Baskets II (Easy)
  17. Guess Number Higher or Lower (Easy)
  18. Intersection of Three Sorted Arrays (Easy)
  19. Intersection of Two Arrays (Easy)
  20. Intersection of Two Arrays II (Easy)
  21. Kth Missing Positive Number (Easy)
  22. Longest Subsequence With Limited Sum (Easy)
  23. Maximum Count of Positive Integer and Negative Integer (Easy)
  24. Minimum Common Value (Easy)
  25. Missing Number (Easy)
  26. Search Insert Position (Easy)
  27. Special Array With X Elements Greater Than or Equal X (Easy)
  28. Sqrt(x) (Easy)
  29. The K Weakest Rows in a Matrix (Easy)
  30. Two Sum Less Than K (Easy)
  31. Valid Perfect Square (Easy)
  32. Apply Operations to Maximize Frequency Score (Hard)
  33. Block Placement Queries (Hard)
  34. Booking Concert Tickets in Groups (Hard)
  35. Closest Room (Hard)
  36. Count Good Triplets in an Array (Hard)
  37. Count of Range Sum (Hard)
  38. Count of Smaller Numbers After Self (Hard)
  39. Count Pairs Of Nodes (Hard)
  40. Count Subarrays With Score Less Than K (Hard)
  41. Count the Number of Incremovable Subarrays II (Hard)
  42. Count the Number of K-Big Indices (Hard)
  43. Create Sorted Array through Instructions (Hard)
  44. Data Stream as Disjoint Intervals (Hard)
  45. Design an Array Statistics Tracker (Hard)
  46. Divide Chocolate (Hard)
  47. Earliest Second to Mark Indices II (Hard)
  48. Escape the Spreading Fire (Hard)
  49. Find a Value of a Mysterious Function Closest to Target (Hard)
  50. Find Beautiful Indices in the Given Array II (Hard)
  51. Find Building Where Alice and Bob Can Meet (Hard)
  52. Find in Mountain Array (Hard)
  53. Find K-th Smallest Pair Distance (Hard)
  54. Find Maximum Non-decreasing Array Length (Hard)
  55. Find Minimum in Rotated Sorted Array II (Hard)
  56. Find Products of Elements of Big Array (Hard)
  57. Find Subarray With Bitwise OR Closest to K (Hard)
  58. Find the Kth Smallest Sum of a Matrix With Sorted Rows (Hard)
  59. Find the Longest Valid Obstacle Course at Each Position (Hard)
  60. Find the Median of the Uniqueness Array (Hard)
  61. Find the Number of Subarrays Where Boundary Elements Are Maximum (Hard)
  62. Find Weighted Median Node in Tree (Hard)
  63. Kth Ancestor of a Tree Node (Hard)
  64. Kth Smallest Number in Multiplication Table (Hard)
  65. Kth Smallest Product of Two Sorted Arrays (Hard)
  66. Last Day Where You Can Still Cross (Hard)
  67. Longest Common Subpath (Hard)
  68. Longest Duplicate Substring (Hard)
  69. Make Array Empty (Hard)
  70. Max Sum of Rectangle No Larger Than K (Hard)
  71. Maximize the Minimum Game Score (Hard)
  72. Maximize the Minimum Powered City (Hard)
  73. Maximum Average Subarray II (Hard)
  74. Maximum Balanced Subsequence Sum (Hard)
  75. Maximum Frequency of an Element After Performing Operations II (Hard)
  76. Maximum Fruits Harvested After at Most K Steps (Hard)
  77. Maximum GCD-Sum of a Subarray (Hard)
  78. Maximum Number of Events That Can Be Attended II (Hard)
  79. Maximum Number of Groups With Increasing Length (Hard)
  80. Maximum Number of Robots Within Budget (Hard)
  81. Maximum Number of Tasks You Can Assign (Hard)
  82. Maximum Partition Factor (Hard)
  83. Maximum Profit in Job Scheduling (Hard)
  84. Maximum Running Time of N Computers (Hard)
  85. Maximum Score of a Good Subarray (Hard)
  86. Maximum Score of Non-overlapping Intervals (Hard)
  87. Maximum Total Beauty of the Gardens (Hard)
  88. Maximum Walls Destroyed by Robots (Hard)
  89. Median of Two Sorted Arrays (Hard)
  90. Minimize Max Distance to Gas Station (Hard)
  91. Minimize the Maximum Adjacent Element Difference (Hard)
  92. Minimum Cost to Make Array Equal (Hard)
  93. Minimum Interval to Include Each Query (Hard)
  94. Minimum Number of Operations to Make Array Continuous (Hard)
  95. Minimum Number of Removals to Make Mountain Array (Hard)
  96. Minimum Operations to Make a Subsequence (Hard)
  97. Minimum Operations to Make Numbers Non-positive (Hard)
  98. Minimum Operations to Make the Array K-Increasing (Hard)
  99. Minimum Space Wasted From Packaging (Hard)
  100. Minimum Stability Factor of Array (Hard)

Companies that ask binary search problems

Before your interview

Most resumes are filtered by software before a recruiter reads them. Check your resume ATS score free, no signup needed.

Other DSA topics