Design a Feature Flag System (Front End)
Design a feature flag and remote configuration system used to gate features in a web and mobile client.
Cover targeting (per user, per segment, percentage rollouts), environments and a kill switch; delivery to clients (an SDK, bootstrapping, caching, polling versus push); consistency guarantees (what a user sees across refreshes and devices); safety (flag dependencies, defaults, failure modes); and the hooks for experimentation and metrics. You may assume whatever backend you need; the focus is the client-side architecture and end-to-end behaviour.
Hints
Hint 1
Evaluate deterministically: a percentage rollout hashes (flag key, salt, user id) into a bucket, so the same user gets the same answer on every device and refresh without storing anything per user.
Hint 2
Deliver a flag snapshot with the first render (embedded by the server or fetched before hydration), then keep it fresh with long polling or server-sent events; cache the last snapshot locally and fall back to defaults compiled into the client.
Hint 3
Treat a flag change during a session carefully: most flags are read once per page load so the UI does not flip underneath the user; a kill switch is the exception and applies at once.
Asked at
Similar Problems6
Sign in to talk to the interviewer — ask what's in scope, what scale to design for, or for a nudge when you're stuck. Conversations save to your account.
Sign in to use the assistant — ask what the problem means, get a hint when you're stuck, or have your current work reviewed. Conversations save to your account.