Calculate the required sample size for an A/B test and explain how each input affects it

Quick Overview

Asks how to work out the sample size an A/B test needs before launch, which inputs go into the calculation, and how changing each input affects the result. It tests power analysis, the trade-off between sensitivity and traffic, and practical test planning.

Calculate the required sample size for an A/B test and explain how each input affects it

Role: Data Scientist

Category: Analytics & Experimentation

Difficulty: medium

Interview Round: Other

Explain how you would calculate the required sample size for an A/B test, what the key inputs are, and how they influence the sample size. ```hint Start from the test you will run Write down the z-statistic for a difference between two conversion rates, then ask what n makes a true difference of the size you care about cross the critical value with the probability you want. ``` ```hint Vary one input at a time Once you have a formula, change each input separately and see how fast n responds. One of them matters far more than the others. ``` ### What a Strong Answer Covers - The inputs to a power calculation and what each one means. - The calculation itself, as a formula or a tool, and that it returns n per group. - The direction and rough size of each input's effect on n, including which input dominates. - Turning n per group into total traffic and a test duration, including tests with more than two variants. - Practical pitfalls when setting up the calculation. ### Follow-up Questions - How would the calculation change for a heavy-tailed continuous metric such as revenue per user? - How does a variance-reduction method such as CUPED change the sample size you need? - Your traffic only supports detecting a 5% relative lift, but the team expects about 2%. What do you do? - How do multiple treatment arms or multiple primary metrics change the significance level and the sample size?

Overview: Asks how to work out the sample size an A/B test needs before launch, which inputs go into the calculation, and how changing each input affects the result. It tests power analysis, the trade-off between sensitivity and traffic, and practical test planning.

General logo
General
Nov 24, 2026
mediumData ScientistOtherAnalytics & Experimentation
0
0

Explain how you would calculate the required sample size for an A/B test, what the key inputs are, and how they influence the sample size.

What a Strong Answer Covers Guidance

  • The inputs to a power calculation and what each one means.
  • The calculation itself, as a formula or a tool, and that it returns n per group.
  • The direction and rough size of each input's effect on n, including which input dominates.
  • Turning n per group into total traffic and a test duration, including tests with more than two variants.
  • Practical pitfalls when setting up the calculation.

Follow-up Questions Guidance

  • How would the calculation change for a heavy-tailed continuous metric such as revenue per user?
  • How does a variance-reduction method such as CUPED change the sample size you need?
  • Your traffic only supports detecting a 5% relative lift, but the team expects about 2%. What do you do?
  • How do multiple treatment arms or multiple primary metrics change the significance level and the sample size?