Google·Data Scientist·Technical Phone Screen
- Implement a function that takes a discharge curve defined by (time, state-of-charge) checkpoints and a current SOC value, then returns how many minutes remain until the battery hits 0%. You need to handle charging segments, duplicate SOC values, missing zero-SOC endpoints via extrapolation, and do it in O(n) time with O(1) extra space. Also explain why the function stays monotone and numerically stable.
“This one took me longer to parse than I expected.”