Why use user-level randomization for user-visible changes, and what goes wrong with session or cookie randomization?

Quick Overview

Asks why experiments on user-visible changes usually randomize by user, and what breaks with session-level or cookie-based assignment. Tests consistency of experience, carryover and dilution, cookie churn across devices, variance when the analysis unit differs from the randomization unit, and when other units are acceptable.

Why use user-level randomization for user-visible changes, and what goes wrong with session or cookie randomization?

Role: Data Scientist

Category: Analytics & Experimentation

Difficulty: medium

Interview Round: Other

Why is user-level randomization often preferred for user-visible changes, and what are the issues with session-level or cookie-based randomization? ```hint Follow one person Picture one person who visits four times in a week from a phone and a laptop. Under each randomization unit, how many arms could they see, and what does that do to the measured effect? ``` ```hint Compare the units Compare the unit you randomize with the unit your metric is computed on, and ask what that does to independence and to the variance estimate. ``` ### What a Strong Answer Covers - Why user-level assignment gives a consistent experience and lets long-run metrics be attributed to one arm - How session-level assignment dilutes effects, lets one session's treatment carry over into the next, and rules out cross-session outcomes - How cookie churn and multiple devices split one person across arms and inflate user counts - The variance problem when the analysis unit is finer than the randomization unit, and how to correct it - When session or cookie randomization is still acceptable ### Follow-up Questions - A logged-out visitor is assigned by cookie and then signs in to an account that was assigned to the other arm. How would you handle the switch? - Your metric is click-through rate per session, but you randomize by user. How do you compute a correct confidence interval? - When is even user-level randomization too fine, and what unit would you use instead?

Overview: Asks why experiments on user-visible changes usually randomize by user, and what breaks with session-level or cookie-based assignment. Tests consistency of experience, carryover and dilution, cookie churn across devices, variance when the analysis unit differs from the randomization unit, and when other units are acceptable.

General logo
General
Nov 24, 2026
mediumData ScientistOtherAnalytics & Experimentation
0
0

Why is user-level randomization often preferred for user-visible changes, and what are the issues with session-level or cookie-based randomization?

What a Strong Answer Covers Guidance

  • Why user-level assignment gives a consistent experience and lets long-run metrics be attributed to one arm
  • How session-level assignment dilutes effects, lets one session's treatment carry over into the next, and rules out cross-session outcomes
  • How cookie churn and multiple devices split one person across arms and inflate user counts
  • The variance problem when the analysis unit is finer than the randomization unit, and how to correct it
  • When session or cookie randomization is still acceptable

Follow-up Questions Guidance

  • A logged-out visitor is assigned by cookie and then signs in to an account that was assigned to the other arm. How would you handle the switch?
  • Your metric is click-through rate per session, but you randomize by user. How do you compute a correct confidence interval?
  • When is even user-level randomization too fine, and what unit would you use instead?