intermediate

Feature flags

Separate code deployment from feature release so teams can merge, test, target, and disable behavior safely.

Feature flags let teams deploy code independently from exposing behavior. They support trunk-based development, targeted rollout, experiments, kill switches, and safer progressive delivery.

| Flag type | Use | |-----------|-----| | Release | Hide incomplete features | | Ops kill switch | Disable broken path quickly | | Experiment | A/B with metrics |

Flags are not authorization—server-side checks still enforce permissions. Long-lived flags become hidden branches in production and need lifecycle cleanup and tests for both states when risk is high.

On interviews: stale flags, test matrix burden, authorization mistakes, config latency, and flag ownership.

Common pitfalls: using flags as security; never removing old flags; shipping only the "on" path in tests.

The trade-off is delivery flexibility versus operational and testing complexity.

Checklist:

  • Separate deploy from release.
  • Define flag lifecycle and owners.
  • Test both flag states when risk is high.
  • Never substitute flags for auth checks.