First Bad Version
A bad commit broke every version after it. Given n versions (1…n) and an isBadVersion(v) API that returns whether version v is bad, find the first bad version. Once a version is bad, all later ones are too — so the good→bad boundary is monotonic and binary-searchable.
The interview point is to minimize API calls (O(log n) not O(n)) — and to avoid the mid-overflow bug. Here isBadVersion is passed in as a parameter (a testable stand-in for the real API, just like fetchJson takes fetch).
firstBadVersion(5, isBadVersion); // 4, if versions 4 and 5 are bad