Binary Search interview questions
Practice 3 questions on binary search. Each runs in a real in-browser editor with Jest tests and a worked, diagram-backed solution.
3 questions
- AlgorithmsCoding exercise
First Bad Version
EASYFind the first failing version among 1..n where a monotonic isBad check flips from false to true — a boundary binary search using the fewest checks.
15 minPractice - AlgorithmsCoding exercise
Integer Square Root
MEDIUMCompute the integer square root — the floor of the real square root — using Newton's method, without Math.sqrt.
25 minPremium questionPractice - AlgorithmsCoding exercise
Median of Two Sorted Arrays
HARDFind the median of two sorted arrays in logarithmic time by binary-searching for the partition that splits all the elements into equal halves.
40 minPremium questionPractice