Testing a Notification-First Account Switcher Ordering
Statistics & ExperimentsModel answerLast 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.
- Before launching, how would you use the historical logs to judge whether the new ordering is likely to help?
- 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.
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
Framing
Two traps sit in this problem. First, the logs come from a deterministic recency policy, so they cannot cleanly answer a causal question. Second, a big notification count may reflect neglect rather than intent: notifications accumulate precisely because the user has not been visiting. A good answer treats the offline work as a go/no-go filter and relies on the experiment for the actual causal estimate.
Part 1: Offline assessment
1. Size the opportunity
Replay both orderings over logged sessions for users with at least two accounts, and measure:
- Divergence rate: the share of sessions where the lists differ at all, and where the first slot differs.
- If the first slot changes in only about 5% of sessions, the overall lift is capped at roughly 5% of whatever the per-session effect is, and the test will be hard to power.
2. Look for revealed demand
In sessions where the most-notified account was not on top, check:
- How often did the user skip the top slot to choose the most-notified account?
- Compare that with the skip rate to another non-top account that has fewer notifications at the same position, which holds position fixed.
- After choosing a high-notification account, did notification opens, conversion, and retention look better?
3. Confounding and bias
- Position bias. Whatever sits on top gets picked partly because it is on top. Estimate a position curve with a click model (examination x relevance), or use natural variation where the same account appeared at different ranks. Then compare at fixed positions.
- No overlap. Under recency ordering, the most recent account is always first, so inverse propensity weighting has no support for "high-notification account in slot 1 when it was not the most recent." Say this plainly. If any randomized or shuffled traffic existed historically, use it for IPS or doubly robust estimates.
- User-level confounding. Heavy users have more accounts, more notifications, and more engagement. Use within-user comparisons (user fixed effects) and control for account age, type, visit frequency, and time of day.
- Reverse causality / staleness. Stratify by time since last visit. If the high-count accounts are mostly dormant for 30+ days, promoting them could bury the account the user actually wanted.
- Selection on observed sessions. Logs contain only sessions that occurred. A new ordering could change whether users return at all, which only an experiment can reveal.
Output: a directional estimate and a decision on whether the test is worth running. It does not prove causality.
Part 2: Experiment design
Eligible population
Users with two or more accounts on supported app versions. Single-account users see no change and would only add noise.
Unit of randomization
The user (person-level ID).
- Session-level assignment would flip the order between visits, breaking habits and creating carryover.
- Account-level assignment is meaningless because the treatment is the ordering across a user's accounts.
- Shared accounts (for example, business pages with several admins) can create mild interference through shared state. Note it, and expect it to be small.
Sessions where both orderings match
Randomize every eligible user, but compute both orderings in both arms and log flags such as lists_differ and top_differs.
- Primary analysis: users with at least one triggered session, with the trigger defined identically in both arms so it cannot depend on assignment. Never trigger on post-treatment behavior (for instance, "user tapped the top account").
- Identical-list sessions receive identical treatment. They dilute the effect and add variance, so exclude them from the triggered estimate.
- Also report the diluted, all-eligible estimate for the launch decision: overall effect is approximately triggered effect x trigger rate.
Metrics
Primary (one or two, fixed in advance):
- Engaged sessions per user: sessions where the user picked an account and took a meaningful action such as opening a notification.
- Alternative: switcher success rate, meaning the user chose the top account and did not immediately switch away.
Secondary: notification open rate per user, conversion or purchase per user, 7-day retention, top-slot selection rate, number of distinct accounts visited.
Guardrails:
- Re-switch rate (chose an account, then switched within N seconds). This is the most direct sign of a wrong ordering.
- Time in the switcher and session abandonment.
- Engagement with the formerly most-recent account.
- Revenue per user.
- Notification disable or unsubscribe rate.
- Latency and crashes.
- Sample ratio mismatch check.
Analyze at the user level. For ratio metrics such as opens per session, use the delta method or cluster-robust standard errors.
Power, MDE, duration
- Per-arm sample size: n ≈ 2(z_{1-α/2} + z_{1-β})² σ² / δ², which is about 15.7 σ²/δ² at α = 0.05 and 80% power.
- Example: mean 4 engaged sessions per week, SD 6, target lift 1% (δ = 0.04). Then n ≈ 15.7 x 36 / 0.0016 ≈ 350k triggered users per arm. If only 30% of eligible users trigger, you need about 1.2M eligible users per arm. This is why triggering and divergence rate matter so much.
- Variance reduction: CUPED using each user's pre-period value of the same metric typically cuts variance 30-50%.
- Duration: at least two full weeks to cover weekly cycles. For 7-day retention, add a 7-day maturation window after the last enrollment.
- Novelty and primacy: users used to recency will need time to adapt. Plot the effect by days since first exposure, and keep a longer holdout if it drifts.
- Pre-register the primary metric and stopping rule. Do not peek, or use sequential testing.
Segments and edge cases
- Number of accounts (2 vs. 5+), personal vs. business, heavy vs. light, new vs. tenured, platform.
- Notification type (social vs. promotional), since promotional spam could inflate counts and hijack the top slot.
- Staleness: segment by days since last visit of the promoted account.
- Count ties, accounts with extreme counts (999+), counts that update mid-session, and users with all-zero counts (identical lists).
- Users with multiple devices, who might see inconsistent orderings if assignment is not keyed on person ID.
Common mistakes
- Treating historical click-through on the top slot as evidence of preference without correcting for position.
- Randomizing by session.
- Analyzing all eligible users and concluding "no effect" when the effect was simply diluted.
- Choosing retention as the only primary metric, which makes the test slow and underpowered.
- Ignoring that a high notification count may signal an abandoned account.
Recommendation shape
Run the replay first. If the first slot changes often enough and revealed demand holds up after controlling for position and staleness, launch a user-level test with the re-switch rate as a key guardrail, and decide on the diluted all-eligible effect.