Follow-up round: a new feature crashes for 5% of users
The setup
You designed feature flags and remote config for an Android app. The app saves the last flag values on disk and uses them for the whole session. New values are fetched in the background and apply at the next start. A team ships a new feature behind a flag. After the release, the feature crashes for 5% of users.
The question
The interviewer asks: "How does the off switch reach those users?"
Stop here and answer out loud for one minute.
A weak reply
"I set the flag to off in the config, and the apps pick it up." That is the normal path, and it is slow. The saved copy can be up to 12 hours old, because Firebase has a 12-hour minimum fetch interval. Then the next-session rule means one more restart. A crash at start happens before any fetch can fix it. A new install with no network gets the default, and if the default is on, the broken feature is on.
A strong reply
The kill switch has four layers. Each one covers a gap in the one before.
- New code defaults to off. A fresh install, or an app with no saved copy, never runs the new feature by accident.
- A kill switch is read live, not once per session. A live update from the flag service changes it while the app is in the foreground.
- If the app crashes twice at start, it ignores the saved copy and uses the defaults.
- The server can refuse the new request. This works even when the flag service is down.
The twist many people miss
The interviewer asks: "The bad value is already saved, and the app crashes at launch."
A good answer: count the starts that never finish. After two, use the defaults and delete the saved copy. Then name the limits:
- The count is only a guard. If the user force-quits in the first seconds, that start counts as a failure too.
- It only catches crashes that happen early. A bad value that crashes a screen later needs the kill switch or a server rollback.
- The next fetch can bring the bad value back, so I fix the server value too. Firebase lets you roll the template back.
Check yourself
- Did you say why the normal config path is too slow, and by how much?
- Did you say the kill switch is the one value read live?
- Did you cover a crash at launch, and what the app does after two failed starts?
- Did you name the limits of the start counter, and the server rollback?
Score your answer on the score sheet.
Go deeper
- Feature flags case: section 4.2 covers the kill switch and its four layers.
- Build guide: the store and the snapshot, and the safe mode that starts after unfinished starts.
- Failure modes: the row on old app versions and bad releases links to where each case handles it.
Get the follow-up round by email
One short email each week. The cheat sheet comes with the first one.
You confirm your address first. Unsubscribe any time. Privacy.