First Bad Version (LeetCode 278): Interview Notes Problem You have n versions [1, 2, ..., n]. A bad version makes all later versions bad. Call isBadVersion(version) to find the first bad one with minimal API calls. Approach Binary search for the leftmost true. Keep lo=1, hi=n. While lo < hi, mid = (lo+hi)//2; if isBadVersion(mid): hi = mid else lo = mid + 1. Return lo. Narrate why mid is never +1 when moving hi. Complexity Time O(log n) API calls, space O(1). Practice tip: https://www.linkjob.ai/interview-copilot/ Disclosure: I work on Linkjob AI.