Video in progress
A bug was found on prod in code you shipped. What do you do in the first hour?
First I tell the team right away, then look for a way to stop the damage (rollback, a feature flag, a hotfix), and after that I investigate the cause. Looking for who's to blame comes later; the main thing is to reduce the impact on users.
📖 Answer
Panicking and hiding are both reactions that make the situation worse.
The first hour goes roughly like this:
- Tell people. In the team channel: what you see, since when, after which release. Don't stay quiet thinking "I'll fix it quickly myself".
- Assess the impact. How many users? Is data being corrupted, or are errors just showing up? This decides how urgent the rollback is.
- Stop the bleeding. Often the fastest way is to go back to the previous version or turn off the feature flag. Rushing a hotfix can bring a new bug.
- Then the cause. Logs, metrics, exactly which case didn't work.
- Fix + test. Write a test that reproduces the bug, then fix it.
If data was corrupted (for example, a wrong amount was written), fixing it is a separate job: you need SQL to find the affected records and an agreed plan.
In an interview, mention the process at the end too: "Afterward we covered this case with a test and added an alert that watches that metric after a release."
Sign up to mark studied questions and save your progress.