How would you go about designing an A/B test for a new feature end-to-end?
Role: Data Scientist
Category: Analytics & Experimentation
Difficulty: medium
Interview Round: Other
How would you go about designing an A/B test for a new feature end-to-end? Walk through the steps from the first hypothesis to the launch decision.
```hint Decide before launch
List what has to be fixed before any data comes in: what you measure, who gets randomized, how many users you need, and how long you run.
```
```hint Trust the data first
Before reading the primary metric, ask how you would know that assignment and logging actually worked.
```
### Clarifying Questions to Ask
- What is the feature, and which user behavior is it supposed to change?
- Which users are eligible, and how many of them reach the feature per day?
- Can users in treatment affect users in control, for example through a shared marketplace, a social feed or limited inventory?
- Which metrics must not get worse, and what does a wrong launch cost?
- Is there a fixed launch date or a seasonal window to work around?
### What a Strong Answer Covers
- A testable hypothesis with a mechanism, one primary decision metric, secondary metrics and guardrails
- The unit of randomization and how it relates to the unit of analysis
- Sample size from the minimum detectable effect, significance level and power, and a duration that covers full business cycles
- Validation of assignment and logging before results are trusted
- An analysis plan fixed in advance and a decision rule that weighs practical significance and guardrails
### Follow-up Questions
- The test shows a significant lift in the first three days that shrinks by the second week. What could be happening, and what do you do?
- How would you change the design for a two-sided marketplace where treated and control users compete for the same supply?
- The primary metric is click-through rate per page view, but you randomize by user. How do you compute its variance?
- A product manager wants to check results every day and stop as soon as the result is significant. How do you respond?
Overview: Asks how to design an A/B test for a new product feature, from the first hypothesis to the launch decision. It tests metric selection, randomization units, power and sample size, checks on assignment and logging, and a disciplined analysis plan.