KatInterview

Designing and Analyzing an Ad-Scheduling A/B Experiment

Statistics & ExperimentsModel answer
HardModel answerStatistics & ExperimentsA/B TestingExperimental DesignCUPED

Last updated

Plan and analyze an ad-scheduling A/B test. Covers randomization, CUPED, ratio metric linearization, sample sizing, multiple testing, and delayed offline conversion handling.

You are an analytics lead designing and executing an evaluation plan for a new ad-scheduling algorithm ($B$) versus the current baseline ($A$).

Today is September 1, 2025. The evaluation window spans 7 complete days ending today: August 26, 2025 through September 1, 2025 inclusive.

System & Business Context

  • Traffic Environment: Users interact with the platform across three client platforms (web, iOS, Android) throughout different time-of-day slots. A single user can experience multiple ad impressions per day.
  • Target & Guardrail Metrics: The primary metric under study is watch_time_per_impression (in seconds). Key guardrail metrics are Click-Through Rate (CTR), skip rate, Daily Active Users (DAU), and user complaint rate.
  • Characteristics: Strong daily and intra-day seasonality exists. A subset of ad inventory consists of long-form video creatives.
  • Delayed Measurement: Offline conversion events (such as subsequent online store visits) report with an ingestion lag of 24 to 48 hours.

Write an experimental plan and data analysis protocol answering the following seven components with explicit statistical justification:

  1. Randomization Strategy & Contamination Control: Explain your choice among user-level, device-level, or impression-level randomization. Detail how you will handle cross-platform activity and time slots. Provide the precise hashing syntax for variant assignment.
  2. Stratification & Variance Reduction (CUPED): Define post-experiment stratification variables. Specify the pre-period date range for CUPED, define the exact baseline covariate, and state the adjusted metric formula.
  3. Metric Formulations & Outlier Handling: Write the exact mathematical formulation of watch_time_per_impression at the unit level, explaining why naive impression-level variance estimation is flawed. Specify your Intent-to-Treat (ITT) protocol and two-stage winsorization rule for outliers.
  4. Hypothesis Testing Framework: Specify whether the primary test should be one-tailed or two-tailed. Formulate the test statistic (e.g., Welch's z-test with linearized ratio variance) and state the non-inferiority setup for guardrails.
  5. Sample Size & Stopping Criteria: Calculate the required sample size per arm assuming a baseline mean of 42 seconds, standard deviation of 55 seconds, target minimum detectable effect (MDE) of $+5%$ relative lift, $\alpha = 0.05$ (two-sided), and power $1 - \beta = 0.80$. Explain how user-level clustering and CUPED alter this calculation, and detail your sequential monitoring policy.
  6. Reporting & Health Diagnostics: Outline the final confidence interval derivation, post-strata aggregation, and multiple-testing correction (e.g., Holm-Bonferroni) across guardrails. List two diagnostics for randomization balance and two for novelty/seasonality effects (note any calendar anomaly on September 1, 2025).
  7. Handling Delayed Offline Signals: Describe how you will re-evaluate results if offline conversion metrics are missing for the final 48 hours of the experiment window, including adjustments to the readout timeline.

Hints

Hint 1

Remember that watch_time_per_impression is a cluster-level ratio metric. The randomization unit is the user, but the denominator is impression count, requiring the delta method or bootstrap to account for variance correctly.

Hint 2

Consider calendar properties of the test window (e.g., September 1, 2025 is Labor Day in the US). Check for day-of-week interactions and holiday effects during diagnostic checks.

Hint 3

When applying CUPED to ratio metrics, ensure the pre-period covariate is constructed identically (e.g., pre-period linearized watch time) to maximize correlation and avoid bias.