I just had an interview where I was asked a tricky version control question. The scenario was: the master branch was passing all tests when I went on vacation, but while I was away, a ton of commits were made. Now that I'm back, the tests are failing, and I need to identify the latest commit that passed the tests. The catch is, building the project takes several hours, and I can only build it once. Checking Git dif and history is not useful because of the immense number of changes. How should I tackle this?
4 Answers
I’d probably check the pipeline history to see the last successful commit that passed all tests. That could help narrow it down without needing to build everything.
The real answer is to avoid merging any commits that don't pass all tests into the master branch. You need a proper setup where only tested code reaches master—it's unreasonable to assume you’ll know their structure if they let untested code through like that.
You might want to try `git bisect`. It’s a handy tool for finding which commit broke things, as long as you can run tests on it.
But how would you run the tests if you can only build once?
Why do I get the feeling that if you land this job, you might end up doing this sort of thing?
Taking vacations? Unlikely... lol.

Yeah, that was my thought too.