← Twitch Interview Insights

Twitch·Data Scientist·Technical Phone Screen·Senior

Senior
May 2026

Summary

Twitch data scientist interview that was basically one giant A/B testing case study broken into six parts. It covered everything from randomization unit choice to variance reduction to integrity checks. Dense and technical, felt more like a take-home exam than a conversation.

Questions Asked (6)

Q1

For an A/B test on reducing pre-roll ad frequency in mobile live streams, how would you choose the randomization unit and why? How do you handle viewers switching between streams and creators sharing audiences, and how do you ensure exposure stickiness across multiple days?

A/B Testing & ExperimentationSystem Design
Author's notes

This tripped me up more than I expected.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining the goal of reducing pre-roll ad frequency and the key metric (e.g., viewer retention or ad load). Then, discuss the trade-offs between randomizing at the viewer level versus the stream/session level, considering interference and network effects. Finally, propose a robust approach like viewer-level randomization with exposure stickiness and methods to handle cross-stream and creator audience overlap.

Pro tip: Consider using a cluster-randomized design at the creator level if spillover effects are strong, but be mindful of reduced power; alternatively, use viewer-level randomization with exposure time as a covariate to adjust for carryover effects.

1. Define the objective and metrics

Clarify the primary metric (e.g., viewer retention, ad recall) and guardrail metrics (e.g., streamer revenue, viewer satisfaction). This guides the choice of randomization unit.

2. Evaluate randomization units

Compare viewer-level, session-level, and creator-level randomization. Viewer-level minimizes confounding but may violate independence due to shared creators; creator-level reduces interference but may require more clusters.

3. Address interference and spillover

For viewers switching streams, use viewer-level randomization with exposure stickiness (e.g., assign a viewer to a variant for the entire test period). For creator audience overlap, consider creator-level randomization or model the network effects.

4. Ensure exposure stickiness

Implement a consistent assignment mechanism (e.g., hashing viewer ID) that persists across sessions and days. Monitor for variant switching and exclude inconsistent exposures.

5. Analyze with appropriate methods

Use cluster-robust standard errors or mixed-effects models to account for clustering. Consider CUPED or exposure-based analysis to increase sensitivity.

Key Points to Mention

  • Randomization unit trade-offs: viewer vs. session vs. creator
  • Interference and network effects due to shared creators
  • Exposure stickiness: consistent assignment across days
  • Handling viewers switching between streams
  • Statistical power and cluster randomization
  • Use of covariates or CUPED to adjust for pre-experiment behavior

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

Q2

What single primary metric would you choose for this ad frequency experiment, and what guardrail metrics would you include? How do you handle heavy-tailed distributions in watch time data and what does that choice mean for your inference?

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

Watch time per viewer per day felt obvious as the primary metric.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining the experiment's goal and the primary metric that directly measures success, then outline guardrail metrics to monitor for unintended harm. For heavy-tailed watch time data, discuss transformations, robust statistical methods, or alternative metrics, and explain the implications for inference such as using bootstrapping or non-parametric tests.

Pro tip: Emphasize that the choice of primary metric should align with the product's north star and be sensitive to the change; for heavy tails, consider using a trimmed mean or percentile-based metric to reduce variance and improve power.

1. Define the experiment goal and primary metric

Clarify the hypothesis and select a primary metric that directly measures the intended effect, such as average watch time per user or total watch time.

2. Select guardrail metrics

Choose metrics that ensure the change doesn't harm other key aspects, such as user retention, churn rate, ad click-through rate, or streamer revenue.

3. Address heavy-tailed distributions

Discuss methods to handle heavy tails, such as log transformation, winsorizing, using median or trimmed mean, or applying bootstrapping for inference.

4. Explain implications for inference

Describe how heavy tails affect statistical power and type I error, and justify the chosen method (e.g., non-parametric tests, robust standard errors) for valid inference.

Key Points to Mention

  • Primary metric should be sensitive to the ad frequency change and aligned with business objectives (e.g., watch time).
  • Guardrail metrics include user retention, churn, ad engagement, and streamer health metrics.
  • Heavy-tailed watch time data can violate normality assumptions; consider transformations or robust statistics.
  • Use of bootstrapping or permutation tests for inference when distributions are skewed.
  • Consider alternative metrics like median watch time or proportion of users watching above a threshold.
  • Ensure sufficient sample size and consider sequential testing or variance reduction techniques like CUPED.

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

Q3

Calculate the required per-variant sample size in viewer-days for this experiment. Baseline mean daily watch time is 36 minutes with a standard deviation of 60 minutes, design effect of 1.3, 5 million eligible daily mobile viewers, two-sided alpha of 0.05, 80% power, and a target of detecting a 2% relative lift.

A/B Testing & Experimentation
Author's notes

The formula part was fine.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, compute the required sample size per variant using the standard formula for comparing two means with a two-sided test, incorporating the design effect. Then, convert the sample size from viewers to viewer-days by dividing by the average number of days each viewer is exposed during the experiment, ensuring the total available viewer-days (5M viewers × experiment duration) is sufficient.

Pro tip: Always clarify the unit of randomization and analysis: if viewers are randomized, the sample size is in viewers, but if randomization is at viewer-day level, the design effect and clustering must be handled differently. Also, consider that the baseline mean and standard deviation are in minutes, so convert the target lift to absolute minutes before calculation.

1. Identify parameters and convert units

Extract baseline mean (36 min), standard deviation (60 min), design effect (1.3), alpha (0.05 two-sided), power (80%), and relative lift (2%). Convert relative lift to absolute difference: 0.02 * 36 = 0.72 minutes.

2. Compute standard sample size per variant

Use the formula for comparing two means: n = (Z_{α/2} + Z_β)^2 * (σ^2 + σ^2) / Δ^2, where Z_{α/2}=1.96, Z_β=0.84, σ=60, Δ=0.72. This gives n ≈ 2 * (1.96+0.84)^2 * 3600 / 0.5184 ≈ 2 * 7.84 * 3600 / 0.5184 ≈ 108,888 viewers per variant.

3. Adjust for design effect

Multiply the sample size by the design effect (1.3) to account for clustering or repeated measures: 108,888 * 1.3 ≈ 141,554 viewers per variant.

4. Convert to viewer-days

Determine the average number of days each viewer contributes during the experiment. If the experiment runs for D days and viewers are exposed daily, then viewer-days per variant = n * D. Alternatively, if the sample size is already in viewer-days, ensure the unit matches. Typically, for a daily metric, the sample size in viewer-days is the same as the number of viewers if each viewer contributes one day. Clarify with the interviewer.

5. Validate against available population

Check that the required sample size per variant does not exceed the available 5 million daily mobile viewers. If it does, consider increasing the experiment duration or relaxing the MDE.

Key Points to Mention

  • Two-sided alpha and power correspond to Z-scores 1.96 and 0.84, respectively.
  • Design effect inflates sample size due to intra-cluster correlation or repeated observations.
  • Conversion from relative to absolute lift: 2% of 36 minutes = 0.72 minutes.
  • Sample size formula for two independent means: n = 2*(Z_{α/2}+Z_β)^2 * σ^2 / Δ^2.
  • Viewer-days as the unit: if each viewer is observed for multiple days, the number of viewer-days is sample size in viewers multiplied by average days per viewer.
  • Feasibility check: required sample size must be ≤ 5 million viewers per variant (or total available viewer-days).

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

Q4

How would you use pre-experiment data to reduce variance in this experiment? Describe the regression you would fit and how you would apply the resulting coefficient to adjust your outcome metric.

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

CUPED question, pretty standard if you've seen it before.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by explaining the concept of using pre-experiment data as a covariate to reduce variance in A/B tests, then describe the specific regression model (e.g., ANCOVA) and how to apply the coefficient to adjust the outcome metric. Emphasize the practical benefits like increased power and sensitivity, and mention potential pitfalls such as overfitting or violations of assumptions.

Pro tip: Highlight that while variance reduction is powerful, it's crucial to pre-register the use of pre-experiment data and the exact model to avoid p-hacking and ensure valid inference. Also, consider the trade-off between variance reduction and bias if the pre-experiment period is not representative.

1. Explain the rationale

Describe how pre-experiment data (e.g., user's historical metric) can explain post-experiment variation, reducing residual variance and increasing power.

2. Specify the regression model

Detail the regression: post-experiment metric ~ treatment + pre-experiment metric (and possibly other covariates). Mention that this is an ANCOVA model.

3. Fit and obtain coefficient

Explain that you fit this regression on the experiment data (or a holdout) to estimate the coefficient (beta) for the pre-experiment metric.

4. Adjust the outcome metric

Describe how to adjust each user's post-experiment metric: adjusted_metric = post_metric - beta * (pre_metric - mean_pre_metric). This centers the pre-metric.

5. Analyze adjusted metric

Perform the treatment effect analysis (e.g., t-test) on the adjusted metric, which has lower variance, leading to more precise estimates.

Key Points to Mention

  • ANCOVA or regression adjustment with pre-experiment covariate
  • Variance reduction and increased statistical power
  • Assumption of linear relationship between pre and post metrics
  • Centering the pre-experiment metric to maintain interpretability
  • Potential issues: overfitting, multicollinearity, and non-representative pre-period
  • Pre-registration to avoid p-hacking and ensure validity

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

Q5

Design a two-week ramp-up plan for this experiment that controls type I error under sequential monitoring. What stopping rules or decision boundaries would you set at interim checks, and how do you account for multiple looks at the data?

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

Alpha spending was my answer.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining the experiment's primary metric and the two-week timeline, then choose a sequential testing method (e.g., alpha spending or group sequential boundaries) that controls type I error across interim looks. Specify the number and timing of interim checks, the stopping rules (e.g., O'Brien-Fleming or Pocock boundaries), and how you'll adjust for multiple comparisons. Finally, discuss practical considerations like traffic volume, minimum detectable effect, and trade-offs between early stopping and statistical power.

Pro tip: Emphasize that you would pre-register the sequential plan and stopping boundaries to avoid p-hacking, and mention that Twitch's high-traffic environment allows for more frequent interim looks without sacrificing power—but you must balance that against operational risks of early stopping.

1. Define experiment parameters and timeline

Specify the primary metric, expected effect size, daily traffic, and the two-week duration. Determine the number of interim looks (e.g., daily or every 3 days) based on traffic and desired power.

2. Choose a sequential testing method

Select a method that controls type I error, such as group sequential boundaries (O'Brien-Fleming, Pocock) or alpha spending functions (Lan-DeMets). Justify the choice based on trade-offs between early stopping and power.

3. Set stopping rules and decision boundaries

Define the exact boundaries for each interim look (e.g., z-scores or p-value thresholds) and the final analysis. Include rules for futility (stopping for no effect) and efficacy (stopping for success).

4. Account for multiple looks and error control

Explain how the chosen method adjusts the overall alpha level across looks, ensuring the family-wise error rate remains at 5%. Mention any adjustments for multiple metrics or subgroups.

5. Discuss practical implementation and trade-offs

Address operational aspects: how to monitor data quality, handle peeking by stakeholders, and communicate results. Highlight trade-offs like increased sample size or reduced power if using conservative boundaries.

Key Points to Mention

  • Type I error control: alpha spending or group sequential methods to maintain overall false positive rate at 5%.
  • Stopping boundaries: O'Brien-Fleming (conservative early, liberal late) vs. Pocock (constant boundaries) and when to use each.
  • Interim look schedule: number and timing of checks (e.g., daily for 14 days) and how it affects power and sample size.
  • Futility monitoring: stopping early for no effect to save resources, using beta spending or conditional power.
  • Pre-registration: importance of pre-specifying the sequential plan to avoid p-hacking and ensure validity.
  • Trade-offs: early stopping can bias effect estimates; consider adjusted estimators or Bayesian methods.

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

Q6

How would you detect and filter out bot traffic and AFK viewers to protect experiment integrity? How would you handle creator-led raids as a source of bias, and what would you do if you detected spillover effects between variants?

A/B Testing & ExperimentationRoot Cause Analysis
Author's notes

Filters for bots and AFK viewers felt manageable: session length thresholds, interaction rate signals, IP clustering.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by framing the problem around experiment integrity: define what constitutes invalid traffic (bots, AFK viewers) and bias sources (creator-led raids, spillover). Then propose a layered detection and mitigation strategy, combining statistical methods with product/engineering solutions, and emphasize proactive monitoring and sensitivity analyses.

Pro tip: Mention that you would pre-register exclusion criteria and run sensitivity analyses to show robustness, and that you'd collaborate with Trust & Safety and engineering to implement real-time filters without harming legitimate users.

1. Define and Detect Invalid Traffic

Identify bot and AFK patterns using behavioral signals (e.g., session duration, interaction rates, IP/device anomalies) and statistical thresholds. Use unsupervised methods like clustering or isolation forests to flag outliers.

2. Filter and Validate Exclusions

Apply filters to remove flagged traffic, but validate by comparing results with and without exclusions. Pre-register rules to avoid p-hacking and monitor false positive rates.

3. Address Creator-Led Raids

Detect raids via sudden spikes in viewership from a single referrer. Treat raids as a separate covariate or stratify randomization by creator to isolate their effect. Consider excluding raid periods or using CUPED with raid as a covariate.

4. Detect and Mitigate Spillover

Test for spillover by checking for interference between variants (e.g., via network analysis or comparing cluster-randomized vs. individual-randomized results). If detected, switch to cluster randomization or use switchback designs.

5. Monitor and Iterate

Set up dashboards to monitor traffic quality and spillover metrics in real-time. Document learnings and refine detection algorithms continuously.

Key Points to Mention

  • Use behavioral metrics (e.g., chat participation, follow/subscribe actions) to distinguish bots/AFK from real viewers.
  • Apply statistical techniques like anomaly detection, clustering, or supervised models if labeled data exists.
  • Pre-register exclusion criteria and run sensitivity analyses to ensure results are robust.
  • For raids, consider creator-level randomization or include raid as a covariate in analysis.
  • Spillover can be detected via network effects or by comparing different randomization units; mitigation includes cluster randomization or switchback experiments.
  • Collaborate with cross-functional teams (engineering, Trust & Safety) to implement real-time filters and monitoring.

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