Problems › Topics › Binary search
Binary search practice problems
Halve the space each step. Anything sorted is a log-n lookup. A pattern: a move you make, and the kind of thing an interview is really asking you to spot. 9 problems in the bank train it, each with a worked example, a hint and a reference solution.
Start a Binary search session →
- Math
- Strings
- Arrays
- Hash maps
- Sorting
- Parsing
- Two pointers
- Sliding window
- Prefix sums
- Stacks
- Binary search
- Intervals
- Grids
- Greedy
- Recursion
- Simulation
- Bit manipulation
9 problems
- The smallest van that still finishes on timehard
- The smallest reading in a wrapped loghard
- Where a value slots inmedium
- Find a value in a sorted listmedium
- Look up a player levelmedium
- How many readings fall in the bandmedium
- The whole-number square rootmedium
- Where the climb turns into a descentmedium
- Which commit broke the buildmedium