Run it
The probe table: five probes over a range of forty-six candidates.
Monotonicity is what licenses the search, so check it rather than assume it.
The same shape on a different question, to show it is a pattern and not a trick.
Apply the same binary search to a different domain: the minimum eating speed to finish a set of piles within a given number of hours.
Recognising it
The tell is a question of the form "what is the smallest X such that something is possible" — smallest capacity, minimum speed, fewest days, largest minimum distance. There is no sorted array in the input, which is why the shape gets missed.
What is sorted is the answer space. If you can write a function feasible(x) that is False for every x below the answer and True for every x at or above it, then the sequence feasible(lo) ... feasible(hi) is sorted — and finding where it flips is exactly binary search.
The three things to establish before writing the loop
The predicate. Here, "can capacity c deliver everything in D days?" Greedily load until the next package would overflow, then start a new day. One pass, O(n), and greedy is optimal for it because leaving room spare can never reduce the day count.
Monotonicity. A bigger ship cannot need more days. State it — this is the step that makes the search valid, and an interviewer will ask why you are allowed to binary search something with no array in it.
The bounds. lo = max(weights), because a package must fit in one trip. hi = sum(weights), because that always finishes in one day. Getting the low bound wrong — starting at 1, or at 0 — produces a search over capacities that can never work, and the loop returns an infeasible answer rather than looping forever, which is worse.
Cost, and the shape of it
O(n log(sum − max)): a logarithmic number of probes, each costing a linear pass. Note that the log is over the magnitude of the answer range rather than the size of the input, which is unusual and worth saying — it means the complexity depends on the numbers, not just on how many there are.
The editor below prints the probe table. Ten packages give a range of 46 candidate capacities and the search settles it in five probes.
The same shape, four other questions
Koko eating bananas — smallest eating speed to finish in H hours. Identical, with ceil(pile / speed) as the per-pile cost.
Split an array into k subarrays minimising the largest sum. The predicate is "can we do it with all parts at most m", and it is the same greedy pass.
Aggressive cows / maximum minimum distance — place k items as far apart as possible. The monotonicity flips direction: large distances are infeasible, so you search for the last True instead of the first.
The square root of an integer, or any inverse of a monotonic function. Once the pattern is visible, "is there a monotonic predicate here?" becomes a routine question to ask of any minimisation problem.
Edge cases to raise
Volunteering these is most of what separates a correct answer from a good one.
Verify the monotonicity. If the predicate flips more than once, binary search returns a boundary that means nothing. Printing it either side of the answer is cheap insurance.
The bounds must bracket the answer. Too low and the search can return an infeasible value; too high only costs a probe or two. When in doubt, err high.
The log is over the magnitude of the answer range, not the input length - so the complexity depends on the size of the numbers. Worth stating, because it is unusual.