Skip to main content
mid
intermediate
CI/CD

Feature Flag Types and Use Cases

Question

Can you walk me through the different types of feature flags and when you'd use each one?

Answer

There are four main types of feature flags, each serving a different purpose. Release flags control the rollout of new features to users. They're temporary and should be removed once the feature is fully released. Example: rolling out a new search UI to 10% of users first. Ops flags are operational toggles for runtime control. They're semi-permanent and used to manage system behavior without redeploying. Example: a kill switch to disable a non-critical service under heavy load. Experiment flags support A/B testing. Users are consistently placed in the same group so you can measure outcomes. Example: testing whether a one-click checkout increases conversion. Permission flags control access to features based on user attributes like subscription tier, region, or role. They're long-lived and tied to business logic. Example: premium features only available to paying users. The important thing is to treat release flags differently from the others. Release flags are technical debt the moment the rollout is complete. You should have a process to clean them up within days, not months.

Why This Matters

This question reveals whether a candidate has practical experience with feature flags beyond basic on/off toggles. Look for awareness of flag lifecycle management, especially cleanup of release flags. Experienced candidates will mention that stale flags are a real operational risk and talk about how they've managed flag hygiene.

Code Examples

LaunchDarkly-style flag definitions showing different types

yaml

Script to find stale feature flags that should be cleaned up

bash
Common Mistakes
  • Treating all feature flags the same without distinguishing release flags from long-lived permission flags
  • Never cleaning up release flags after full rollout, leading to code full of dead branches
  • Not considering that experiment flags need consistent user bucketing to produce valid results
Follow-up Questions
Interviewers often ask these as follow-up questions
  • How would you prevent stale feature flags from piling up in your codebase?
  • What's the risk of having hundreds of active feature flags at once?
  • How do you test all the different flag combinations?
  • Would you store feature flags in your code repo or use a dedicated service?
Tags
feature-flags
progressive-delivery
ci-cd
release-management
a-b-testing