Interview practice question
Type-safe feature flags
Frontend Engineering · TypeScript · Experienced
Feature flag names are strings scattered throughout your code, and removed flags leave dead references. How would you make flags type-safe?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Central flag definitions with types.
- Generated types from flag service.
- Typed helper (isEnabled(flag: FlagName)).
- Variation types per flag.
- Removing flag causes compile errors at usages.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.