KatInterview

Testing a Notification-First Account Switcher Ordering

Statistics & ExperimentsModel answer
MediumModel answerStatistics & Experimentsab-testingcausal-inferenceposition-bias

Last updated

Judge whether sorting a user's accounts by pending notifications beats sorting by recency, using past logs first and then a well-scoped randomized experiment.

Context

An app lets people hold several accounts and switch among them from a list. Today that list is ordered by how recently each account was used. A proposal would reorder it so the account with the most unread notifications comes first, with ties resolved by recency. The reasoning is that surfacing the account with the most waiting activity should raise engagement.

You have historical session logs at the user-session-account level. Each record includes:

  • the ordered list of accounts that were displayed
  • the notification count of each account when the session began
  • each account's last-visit timestamp
  • which account (if any) the user picked
  • whether any notification was opened
  • later outcomes such as purchases and 7-day retention

Task

Walk through how you would answer both questions below.

  1. Before launching, how would you use the historical logs to judge whether the new ordering is likely to help?
  2. Design a randomized experiment to measure the true causal effect of the new ordering.

Your answer should cover:

  • who is eligible for the test
  • what the randomization unit is
  • primary metrics, secondary metrics, and guardrails
  • how you deal with confounding and selection bias in the log analysis
  • how to treat sessions where both orderings would produce the same list
  • power, minimum detectable effect, and run length
  • the segments and edge cases you would examine

Hints

Hint 1

Before any modeling, replay both orderings on the logs and measure how often they actually differ, especially in the first slot. That caps the achievable effect.

Hint 2

Logged data comes from a deterministic policy, so the first slot is always the most recent account. Think about what that does to position bias and to your ability to reweight, and what a large pile of notifications might really indicate about a user's relationship with that account.

Hint 3

For the experiment, ask what you randomize on (not session, not account), how you define the analyzed group so it cannot depend on treatment, and how the dilution from identical-list sessions affects sample size.