Lesson 15 of 30
A runtime switch that decides whether a piece of code path is active — separating 'is this code deployed' from 'is this feature turned on,' which is the whole trick behind shipping safely and often.
11 min read
Every option explains itself — why the right one is right, and why each wrong one is wrong. Miss one and it comes back later on a spaced-repetition schedule.
Question 1 of 2
A newly-released feature is causing errors in production. With a feature flag in place, what's the fastest way to stop the bleeding?
Hints without spoilers, and a plain explanation of why a wrong answer was wrong — answered only from this lesson. Free account, no card.
Sign up freeWhat interviewers actually ask about this, and what a strong answer has to cover.
A strong answer covers
Likely follow-ups
Without feature flags, "deploy" and "release" are the same moment — the instant your code ships, every user sees it. A feature flag decouples them: the code can be deployed, dormant, behind a check, and turned on later — for everyone at once, for a percentage of users, or for specific accounts — with no new deploy required to flip it.
function Dashboard() {
const showNewLayout = useFeatureFlag("new-dashboard-layout");
return showNewLayout ? <NewDashboardLayout /> : <LegacyDashboardLayout />;
}
if (flags.newCheckout) { <NewCheckout /> } else { <OldCheckout /> } — both code paths ship in the same deploy.
"How would you safely roll out a risky change to production?" is a real operational question, and feature flags (gradual rollout, instant rollback, decoupling deploy from release) is the concrete, industry-standard answer — far stronger than "test it really well before shipping."