EXPERIMENTATION & A/B TESTING · INTERVIEW QUESTION
How do you calculate required sample size?
🟢 beginner · A/B Testing
Hint: Focus on the decision rule, assumptions, and failure mode behind a/b testing.
Answer
You need baseline variance/rate, minimum detectable effect, significance level, power, allocation ratio, and test type. Smaller effects require much larger samples.
Interview reasoning
For a simple two-arm mean comparison, sample size grows with variance and roughly inverse squared detectable effect. Binary outcomes also depend on baseline conversion and the absolute effect.
Power is the probability of detecting a specified effect under the design assumptions. Required sample size depends on variance, alpha, power, allocation, minimum effect and analysis unit. For equal-sized independent arms, a common normal approximation is n per arm approximately 2 sigma squared (z_alpha/2+z_beta)^2 divided by delta squared.
Worked example. For baseline conversion 0.1, variance 0.09, delta 0.01, alpha 0.05 and power 0.8, the approximation gives about 14,112 users per arm.
Validation
Plan alpha, power, allocation, MDE, and stopping rules using historical variability.
Check assumptions with historical unit-level variance and simulation; account for clustering, multiple comparisons and outcome maturity.
Common pitfalls
A target effect chosen after observing results does not recover prospective power.
Relative 1% and absolute one percentage point are different deltas. Large row counts do not create power when independent units are few.
Likely follow-up: Plan alpha, power, allocation, MDE, and stopping rules using historical variability.