← Instacart Interview Insights

Instacart·Data Scientist·Technical Phone Screen·Senior

Senior
May 2026

Summary

Instacart data science interview with a pretty gnarly experiment design question that covered sample sizing, sequential testing, and variance reduction all in one prompt. Felt more like a stats exam than a conversation.

Questions Asked (3)

Q1

Given a baseline same-day delivery attach rate of 22%, a minimum detectable relative lift of 5%, standard alpha and power settings, and 120k daily eligible checkouts (with only 20% of site traffic qualifying and strong Sunday variation), calculate the required sample size per arm and convert that to calendar days while accounting for day-of-week seasonality and a 10% cluster correlation from households.

A/B Testing & ExperimentationProduct Analytics & Metrics
Author's notes

This took me way longer than it should have.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, compute the required sample size per arm using the baseline rate (22%), minimum detectable relative lift (5%), and standard alpha (0.05) and power (0.80). Then, adjust for the 10% cluster correlation by inflating the sample size using the design effect (1 + (m-1)*ICC), where m is the average cluster size. Finally, convert to calendar days by dividing by the daily eligible traffic (120k * 20% = 24k) and accounting for day-of-week seasonality by ensuring full weeks are run and possibly using a stratified or blocked design.

Pro tip: Always clarify the unit of randomization and analysis: if households are clusters, the analysis must account for intra-cluster correlation, and the sample size must be inflated accordingly. Also, consider using a sequential or group sequential design to monitor the experiment and stop early if needed, but be cautious with peeking.

1. Calculate base sample size

Use the formula for two-proportion z-test: n = (Zα/2 + Zβ)^2 * (p1*(1-p1) + p2*(1-p2)) / (p2-p1)^2, where p1=0.22, p2=0.22*1.05=0.231, alpha=0.05, power=0.80. This gives the required sample size per arm without clustering.

2. Adjust for cluster correlation

Compute the design effect (DE) = 1 + (m-1)*ICC, where m is the average cluster size (e.g., number of eligible checkouts per household) and ICC=0.10. Multiply the base sample size by DE to get the adjusted sample size per arm.

3. Convert to calendar days

Divide the adjusted sample size per arm by the daily eligible traffic (120,000 * 0.20 = 24,000) to get the number of days per arm. Since both arms run concurrently, the total duration is the same as the days per arm. Round up to the nearest whole week to account for day-of-week seasonality.

4. Account for seasonality

Ensure the experiment runs for complete weeks (e.g., 7, 14, 21 days) to balance day-of-week effects, especially strong Sunday variation. Consider using a stratified randomization by day-of-week or including day-of-week as a covariate in analysis.

Key Points to Mention

  • Baseline conversion rate and minimum detectable effect (relative lift) are used to compute sample size.
  • Standard alpha (0.05) and power (0.80) are typical defaults; clarify if one-sided or two-sided test.
  • Cluster correlation (ICC) inflates sample size; design effect formula and average cluster size are needed.
  • Daily eligible traffic is 20% of total site traffic, so 24,000 checkouts per day.
  • Day-of-week seasonality requires running full weeks and possibly blocking or stratification.
  • Consider practical constraints like experiment duration, novelty effects, and potential dilution from non-eligible traffic.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

Design a peeking-safe monitoring plan for this experiment using something like group sequential testing or alpha spending functions, and explain how that approach changes the expected experiment duration compared to a fixed-horizon design.

A/B Testing & ExperimentationTechnical Trade-offs
Author's notes

I knew the concept but stumbled explaining the tradeoff clearly.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by framing the trade-off between early detection and false positive control, then propose a group sequential design with alpha spending (e.g., O'Brien-Fleming) tailored to Instacart's business metrics. Explain how peeking inflates Type I error and how alpha spending preserves it, then compare expected duration under fixed-horizon vs. sequential designs, highlighting the impact of effect size and stopping boundaries.

Pro tip: Quantify the expected sample size reduction using software like gsDesign or simulation, and mention that you'd pre-register the analysis plan to avoid p-hacking—this shows statistical rigor and business pragmatism.

1. Define the problem and constraints

Clarify the experiment's primary metric, desired power, significance level, and business constraints (e.g., cost of running longer, risk of shipping a bad feature).

2. Choose a sequential design

Select a group sequential approach (e.g., O'Brien-Fleming, Pocock) or alpha spending function that balances early stopping and power, considering the number of interim looks and timing.

3. Compute boundaries and expected duration

Use software (e.g., gsDesign, R) to derive stopping boundaries and calculate the expected sample size under the alternative hypothesis, comparing it to a fixed-horizon design.

4. Explain the trade-offs

Discuss how sequential testing can reduce expected duration when effects are large but may increase maximum sample size; also note the need for pre-registration and monitoring.

5. Operationalize the plan

Outline how to implement the monitoring plan in practice, including data pipelines, decision rules, and communication with stakeholders.

Key Points to Mention

  • Peeking problem: inflates Type I error if not adjusted.
  • Alpha spending functions: allocate alpha across interim analyses (e.g., O'Brien-Fleming spends little early).
  • Group sequential testing: pre-specified interim looks with adjusted boundaries.
  • Expected duration: under sequential design, expected sample size is often lower than fixed-horizon when treatment effect is large, but maximum sample size may be higher.
  • Trade-offs: early stopping for efficacy vs. futility, and impact on power.
  • Tools: gsDesign, sequential package in R, or simulation to compute boundaries and expected duration.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q3

If the attach rate metric is especially volatile on Sundays, how would you use stratified randomization or CUPED to reduce variance, and can you quantify the expected variance reduction and its effect on how long the experiment needs to run?

A/B Testing & ExperimentationProduct Analytics & Metrics
Author's notes

Honestly the most interesting part of the whole thing.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by explaining how Sunday volatility inflates variance and why standard randomization may not balance covariates. Then describe how stratified randomization or CUPED can reduce variance, and quantify the expected reduction using historical data and the resulting impact on experiment duration.

Pro tip: Emphasize that CUPED requires a pre-experiment covariate correlated with the metric; for Sunday volatility, using the same day-of-week historical attach rate as the covariate can yield substantial variance reduction. Also, mention that stratification must be based on pre-experiment variables to avoid bias.

1. Diagnose the volatility

Analyze historical Sunday attach rate data to quantify its variance and identify potential covariates (e.g., user activity, past attach rate) that explain the volatility.

2. Choose a variance reduction method

Decide between stratified randomization (if strong categorical covariates exist) and CUPED (if a continuous pre-experiment covariate is available). Explain the trade-offs.

3. Implement and validate

Apply the chosen method: for stratification, define strata based on covariates and randomize within; for CUPED, compute the covariate-adjusted metric using pre-experiment data. Validate that the method reduces variance without introducing bias.

4. Quantify variance reduction

Use historical data to estimate the variance reduction: for CUPED, compute 1 - ρ² where ρ is the correlation between pre-experiment covariate and the metric; for stratification, compute the between-strata variance explained.

5. Estimate impact on experiment duration

Translate variance reduction into sample size savings: required sample size is proportional to variance, so a variance reduction of X% reduces sample size by X% (for fixed power). Then compute the new duration based on traffic.

Key Points to Mention

  • CUPED uses pre-experiment covariate to adjust post-experiment metric, reducing variance by (1 - ρ²) where ρ is the correlation.
  • Stratified randomization balances covariates across treatment groups, reducing variance by eliminating between-strata differences.
  • Sunday volatility may be due to day-of-week effects; using day-of-week as a stratifier or covariate can help.
  • Variance reduction directly reduces required sample size and thus experiment duration, assuming constant traffic.
  • Quantification requires historical data to estimate correlation or stratum variances; without data, provide a hypothetical example.
  • Mention that both methods require pre-experiment data and careful implementation to avoid bias.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.