Amazon·Frontend Engineer·Technical Phone Screen
- You're given an array of logs, each with a status (success or failure) and a timestamp. Failures are monotonic, meaning once a failure appears, everything after it is also a failure. Find the timestamp of the first failure, or return that no failure exists. Walk through both a linear scan and a binary search solution.
“I went straight to the linear scan from the end, which works fine but is O(n) and I kind of knew they'd push back.”