Calculate Sample Size for Effective A/B Test Design
Quick Overview
This interview question evaluates metric design, causal reasoning, experiment setup, diagnostics, SQL/statistical checks, and recommendations in a realistic interview setting. A strong answer for Calculate Sample Size for Effective A/B Test Design states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.
Calculate Sample Size for Effective A/B Test Design
Company: Walmart Labs
Role: Data Scientist
Category: Analytics & Experimentation
Difficulty: medium
Interview Round: Onsite
##### Scenario
Designing an A/B test for a marketing feature rollout.
##### Question
How do you calculate the required sample size for an A/B test?
What techniques can improve the statistical power of the experiment?
##### Hints
Use power analysis (effect size, alpha, beta); improve power with variance reduction, stratification, larger samples, longer tests.
Quick Answer: This interview question evaluates metric design, causal reasoning, experiment setup, diagnostics, SQL/statistical checks, and recommendations in a realistic interview setting. A strong answer for Calculate Sample Size for Effective A/B Test Design states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.
Calculate Sample Size for Effective A/B Test Design
A/B Test Planning: Sample Size and Power
Scenario
You are planning an online A/B test to evaluate a new marketing feature. The primary success metric is a user-level conversion rate (binary: converted vs. not). You need to determine the required sample size and ways to maximize the test's statistical power under realistic constraints.
Questions
How do you calculate the required sample size for an A/B test?
What techniques can improve the statistical power of the experiment?
Constraints & Assumptions
Preserve the scope, facts, inputs, and requested outputs from the prompt above.
If the prompt leaves a detail unspecified, state a reasonable assumption before relying on it.
Keep the answer interview-ready: concise enough to present, but concrete enough to implement or evaluate.
Clarifying Questions to Ask Guidance
Clarify the business objective, unit of analysis, time window, exposure definition, and primary metric.
State assumptions about instrumentation, randomization, sample size, and data quality.
Separate descriptive analysis from causal claims.
What a Strong Answer Covers Guidance
A metric framework with primary, guardrail, and diagnostic metrics.
A credible analysis or experiment design with clear assumptions and bias checks.
SQL/statistical logic for segmentation, variance, confidence, and data validation where relevant.
An actionable recommendation that explains trade-offs and next steps.
Follow-up Questions Guidance
What sanity checks would you run before trusting the result?
How would you handle novelty effects, seasonality, or selection bias?