KatInterview

Build an experimentation system for product launches

Statistics & ExperimentsModel answer
HardModel answerStatistics & Experimentsexperimentationstatistical-analysisdistributed-systems

Last updated

Design a platform that randomly assigns users to variants, logs their behavior, computes metrics, and determines statistical significance.

You're tasked with building an experimentation platform that enables product teams to test changes before launching them to all users.

The system must handle the full lifecycle:

  • Creating tests with multiple variants and allocation rules
  • Assigning users to variants consistently
  • Recording when users see each variant
  • Tracking outcome events (clicks, purchases, engagement)
  • Computing metrics and determining whether differences are statistically significant
  • Protecting against bad launches with automatic guardrails

Your organization has roughly 1 billion daily active users. Product teams run around 1,000 tests at any given time, and a typical user participates in 20–50 overlapping tests simultaneously.

Assignment must happen with sub-millisecond latency, even if backend services are temporarily unavailable. The event pipeline processes around 100 billion events daily. Metric reports should be available within hours, while safety guardrails need to run every 15 minutes.

Describe your design, covering:

  • How you assign users to variants deterministically and at scale
  • The architecture for logging exposures and outcome events
  • How you compute metrics and statistical significance
  • Mechanisms to avoid bias and ensure valid results
  • How you handle rollouts, overlapping tests, and safety guardrails

Hints

Hint 1

Think about how to keep assignment logic fast and deterministic using hashing rather than remote calls

Hint 2

Consider what happens when you analyze data at a different granularity than you randomized (e.g., randomize per user but measure per pageview)

Hint 3

Exposure logging matters: if you only log when the new feature renders, you introduce selection bias