Practice this topic in a realistic system design interview
Deploying code used to mean releasing a feature to everyone. Once the code reached production, the new behavior was live. If it broke, the usual fix was to roll back the whole deploy.
A feature flag separates deploying code from releasing behavior. The code can be in production, but a setting decides who actually sees the new feature.
That makes releases safer. You can turn a feature on for employees, then beta users, then 1%, then everyone, without deploying again. If something breaks, you turn the flag off instead of rolling back the code.
This chapter explains how feature flags work, where flag decisions should happen, how gradual rollouts work, and how to keep flags from turning into long-term mess.