What is your approach to setting up control and treatment groups?
Role: Data Scientist
Category: Analytics & Experimentation
Difficulty: easy
Interview Round: Other
What is your approach to setting up control and treatment groups? Walk through what you decide before launch, how units get assigned, and what you check before you trust the comparison.
```hint Start with the unit
Decide what you are randomizing (users, sessions, accounts, regions) before deciding how to split it, and ask whether units in different groups can affect each other.
```
### What a Strong Answer Covers
- Committing in advance to the hypothesis, primary and guardrail metrics, minimum detectable effect, significance level and power, and turning them into a sample size and runtime.
- Choosing the randomization unit and explaining when spillover or shared state pushes it to accounts or geographies.
- An assignment mechanism that is random, stable across visits and independent of other running experiments, with treatment differing from control by one change.
- Validation before reading results: a sample ratio mismatch check and a pre-experiment balance check or A/A test.
- Running for the planned duration without unadjusted peeking, and analyzing at the randomization unit.
### Follow-up Questions
- You planned a 50/50 split and see 1,012,000 users in control and 988,000 in treatment. Is that a problem, and what would you investigate?
- When would you randomize by city or by week instead of by user, and what does that do to the sample size you need?
- How would you keep assignment consistent for a user who visits logged out on one device and logged in on another?
- How does adjusting for a pre-experiment covariate (CUPED, for example) change the required sample size?
Overview: Asks how to set up control and treatment groups for an online experiment, from choosing metrics and a randomization unit to assigning users and checking the split. Tests experiment design basics such as power and sample size, salted hashing, sample ratio mismatch checks and covariate balance.