Design a Feature Flag SDK – Frontend System Design

We’ll walk through the frontend system design for a client feature-flag SDK and the admin UI that authors flags. You’ll see why the SDK evaluates a downloaded ruleset in memory, how to put the right variant on the first frame, how targeting and percentage rollouts stay deterministic, and where sticky assignments, kill switches, typed flags, cache, and privacy sit.
The interviewer usually phrases it as “design LaunchDarkly” or “design a feature-flag SDK”. A if (flag) renderV2() wrapper takes five minutes. The real question is the rest: a page that paints before the ruleset arrives, a 10% rollout that must not reshuffle on reload, a kill switch that cannot wait for the next poll, and a public client key, so the ruleset cannot hold your VIP email list.
Problem Statement
Design a JavaScript feature-flag SDK for a large web app, plus the admin UI that manages flags.
Requirements:
- Flags evaluate locally. A render must not wait on the network.
- The first paint uses the correct variant. No flicker of... premium content.
