Amazon·Frontend Engineer·Technical Phone Screen
- You're given an array of logs where each log has 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 approach and an optimized solution.
“I jumped straight to the linear scan from the back of the array and got it working, but they sat there waiting.”