KatInterview

Geometric Sessions, A/B Sizing, and Bootstrap on Skewed Engagement

Statistics & ExperimentsModel answer
HardModel answerStatistics & Experimentsgeometric-distributionsample-sizeab-testing

Last updated

Four linked statistics questions: geometric session probabilities, two-proportion sample sizing, why a t-test and bootstrap CI disagree on skewed data, and a ship/no-ship recommendation.

Context

You own the analysis of an A/B test on a new ranking model for a content-discovery feed. The test ran for 14 days. Two metrics matter:

  • repins_per_user: the average number of saves per user (a count metric).
  • user_save_rate: the share of users who save at least one item (a proportion).

Answer the four connected parts below.

Part 1: Session dynamics

Within a session, a user sees items one at a time. Impressions are independent, and each is saved with probability p = 0.08. The session ends right after the first save.

  1. What is the probability that a user views more than 10 items in a session?
  2. A user has already viewed 8 items with no save. What is the probability that they view more than 12 items in total?

Part 2: Sizing the experiment

You plan a two-sided, two-sample test on user_save_rate with control rate p0 = 0.25. You want to detect a 2% relative lift (p1 = 0.255) with 80% power at alpha = 0.05.

  1. Write the per-variant sample size n using the normal approximation, and evaluate it.
  2. Explain how the required n changes if you instead size for the continuous metric repins_per_user and assume variance is 4 times the mean (sigma^2 = 4 * mu), compared with a Poisson assumption (sigma^2 = mu).

Part 3: Bootstrap on a heavy-tailed metric

The test ended with N = 100,000 users per arm. For repins_per_user, more than 70% of users have zero repins, and the top 1% of users produce 45% of all repins.

  • A two-sample t-test on the difference in means gives p = 0.038 favoring treatment.
  • A 10,000-resample percentile bootstrap gives a 95% CI for mu_treatment - mu_control of [-0.004, 0.052].

Explain mathematically why these two results disagree, and say which one you trust more and why.

Part 4: The launch decision

A product manager wants to ship immediately because "p < 0.05". State your recommendation, explain how you would respond to that argument, and list the extra analyses you would run before a final decision (for example transformations, trimming, or a stratified bootstrap).

Hints

Hint 1

In Part 1, 'more than k items' means the first k impressions were all non-saves. Think about what independence implies once 8 non-saves have already happened.

Hint 2

For Part 2, the sample size depends on the variance under the null and under the alternative. Check whether the planned 100,000 per arm actually meets the requirement before analyzing results. For the count metric, remember n scales linearly with variance.

Hint 3

For Part 3, compare the standard error implied by p = 0.038 with the one implied by the bootstrap interval width. Then think about skewness, how fast the CLT kicks in, and whether the analysis unit was really the user.