Concurrent Shelf and Item Ranking A/B Tests

Medium · Analytics & Experimentation · Data Scientist · Technical Screen

Prompt

A consumer shopping-and-rewards mobile application organizes its browse screen into horizontal shelves, where each shelf showcases a collection of items. Two ranking layers govern what a shopper sees: one algorithm orders the individual items inside each shelf, and a second algorithm orders the shelves vertically from top to bottom.

Product engineering plans to run two concurrent A/B tests on this surface:

  • Experiment 1 (Within-shelf item ranking): Alters how items are ordered inside each shelf, enrolling 50% of app traffic.
  • Experiment 2 (Vertical shelf ranking): Alters the top-to-bottom sequence of shelves across the screen, enrolling 9% of app traffic.

The overarching business objective is to lift shopper engagement and downstream conversion—measured through signals such as item taps, cart additions, completed orders, gross spend, or receipt uploads.

Address the following four questions:

  1. Which experimental design choices and analytical prerequisites matter most before launching and reading out these two tests?
  2. Suppose traffic between the two tests cannot be fully isolated into separate user pools. Does traffic overlap invalidate both readouts? Explain why or why not.
  3. When a subset of shoppers experiences both experiments simultaneously, how can you quantify how Experiment 2 alters the treatment effect of Experiment 1?
  4. Which decision metrics, safety guardrails, statistical health checks, and rollout-interpretation pitfalls should your evaluation plan cover?

Scope & Expectations

  • Randomization & power planning: Specify the randomization unit, hashing independence, exposure logging trigger, run horizon, and minimum detectable effect implications of the asymmetric 50% vs. 9% traffic split.
  • Causal validity under overlap: Distinguish independent orthogonal assignment from true threats to validity (correlated hashing, cross-session contamination, and shared-budget interference), showing how interaction effects affect standalone vs. joint rollout estimates.
  • Interaction estimation: Formulate a concrete method (such as a 2x2 factorial contrast or regression model) to estimate Experiment 2's moderating effect on Experiment 1, noting its variance and confidence-interval behavior.
  • Metrics & statistical rigor: Structure primary, diagnostic, and guardrail metrics at the proper unit of analysis alongside pre-readout integrity checks (sample ratio mismatch, pre-period balance, variance reduction, and cannibalization/novelty checks).

Step-by-step walkthrough

  1. Map both experiments onto one user grid

    Imagine a grocery store running two layout tests in the same week: Experiment 1 (E1) rearranges which items sit at eye level inside each shelf, while Experiment 2 (E2) rearranges which shelves sit closest to the front entrance. Both changes touch the exact same shopping screen, so whether a user taps a product can depend on both which shelf appears near the top and which products appear first inside that shelf.

    The scenario allocates a 50% traffic share to E1 and a 9% traffic share to E2. Standard practice is to split each experiment's enrolled traffic evenly between control and treatment (25% / 25% for E1; 4.5% / 4.5% for E2), while un-enrolled users (50% for E1; 91% for E2) continue seeing today's default app ordering.

    If the experimentation platform assigns each experiment using an independent hash salt (a unique string appended to user_id before hashing so the two experiments shuffle users independently), every user lands in one cell of a 3 x 3 grid whose shares multiply cleanly:

                             E2 control (4.5%)   E2 treatment (4.5%)   Not in E2 (91.0%)
    E1 control   (25.0%)          1.125%               1.125%               22.750%
    E1 treatment (25.0%)          1.125%               1.125%               22.750%
    Not in E1    (50.0%)          2.250%               2.250%               45.500%
    

    With an illustrative 1,000,000 weekly exposed shoppers: - E1 compares 250,000 control users against 250,000 treatment users. - E2 compares 45,000 control users against 45,000 treatment users. - The 2x2 overlap contains four cells of 11,250 users each (45,000 users total).

  2. Nail down the experiment design: unit, trigger, duration, and power

    Before analyzing a single row of data, several design choices determine whether the two tests are trustworthy:

    • Randomize by user, never by session or request. Ranking changes must stay consistent across visits; otherwise a shopper sees shelves jump around between sessions, and delayed outcomes like purchases or receipt uploads cannot be tied cleanly to one variant.
    • Use independent hash salts. Hashing user_id + "exp1_product_rank" and user_id + "exp2_shelf_rank" guarantees that E1 control and E1 treatment each contain the same 4.5% fraction of E2 treatment users. Reusing the same salt would trap all 9% of E2 inside a single slice of E1 and confound both tests.
    • Trigger on entering the shelf surface, not on viewing a specific shelf. Many users open a rewards app only to check their point balance and never visit the shopping shelves; including unexposed users dilutes real effects toward zero. Log an exposure trigger (the timestamp when a user first loads the shelf screen) symmetrically in both arms. Never trigger on "user saw Shelf X," because E2 moves Shelf X up or down — that would create post-treatment selection bias (where the treatment itself changes who enters your analysis sample).
    • Run whole weeks and pre-register. Shopping and receipt-scanning habits swing sharply between Tuesdays and Saturdays, so run for full 7-day multiples (at least 2 weeks to let initial curiosity settle) and lock in metrics, duration, and ship criteria beforehand (pre-registration).
    • Check statistical power, especially for E2's 9% slice. Statistical power is the probability of detecting a true effect when it exists (standard target: 80%), and the minimum detectable effect (MDE) is the smallest true change a test can reliably separate from noise at a two-sided 5% significance level. For a binary conversion rate near p = 10% (p * (1 - p) = 0.09), MDE = (1.96 + 0.84) * SE:
    Comparison                   Users per arm / cell    Standard error (SE)    MDE (abs / relative)
    E1 main effect               250,000 vs 250,000         0.085 pts           0.24 pts  (2.4% rel)
    E2 main effect                45,000 vs  45,000         0.200 pts           0.56 pts  (5.6% rel)
    E1 x E2 interaction (2x2)     11,250 in each of 4       0.566 pts           1.58 pts (15.8% rel)
    

    Because E2 only gets 9% of traffic, its MDE (0.56 percentage points) is more than twice as wide as E1's (0.24 points). If shelf reordering is expected to move conversion by 0.3 points, E2 at 9% is under-powered and will likely look "flat" by chance unless we run longer, raise traffic, or apply variance reduction.

  3. Are overlapping results unusable? No — here is what overlap actually does

    Overlapping traffic does NOT make the experiment results unusable, provided the two assignments are independent.

    Why? Because independent hashing balances E2 evenly across E1's arms: 4.5% of E1 treatment users and 4.5% of E1 control users receive E2 treatment. Any standalone boost from E2 is added equally to both sides of E1 and cancels out when we take the difference. E1's estimator remains unbiased for E1's average effect across today's app traffic.

    What overlap does affect is how the estimate generalizes if both experiments ship, whenever there is an interaction effect (gamma, the extra synergy or friction that occurs only when a user gets both E1 treatment and E2 treatment at once). Let tau1 be E1's lift under the current shelf order, tau2 be E2's lift under the current product order, and gamma be their interaction:

    E1 measured lift = 0.955 * tau1 + 0.045 * (tau1 + gamma) = tau1 + 0.045 * gamma
    E2 measured lift = 0.750 * tau2 + 0.250 * (tau2 + gamma) = tau2 + 0.250 * gamma
    
    Worked numeric example: tau1 = +0.80 pts, tau2 = +0.40 pts, gamma = -0.40 pts
      - E1 measures:  0.80 + 0.045 * (-0.40) = +0.782 pts   (almost purely tau1)
      - E2 measures:  0.40 + 0.250 * (-0.40) = +0.300 pts   (25% of E2 sits in E1 treatment!)
      - If BOTH ship to 100% of users:
          combined lift = tau1 + tau2 + gamma = 0.80 + 0.40 - 0.40 = +0.80 pts (NOT +1.20 pts!)
    

    Notice the asymmetry: only 4.5% of E1 sees E2 treatment, so E1's headline number barely budges, whereas 25% of E2's traffic sits inside E1 treatment, shifting E2's headline estimate noticeably.

    Overlap only breaks validity under three specific failures: 1. Correlated assignment (shared hash salt or enrolling E2 only inside E1's treatment group). If all four (E1, E2) cells still have users, you can salvage unbiased estimates by computing E1's lift separately inside each E2 arm; if a cell has zero users, the effects are mathematically inseparable there. 2. User contamination (logged-out/logged-in identity splits or caching bugs letting one shopper experience both orderings), which dilutes treatment differences toward zero. 3. Shared resource competition (a violation of SUTVA, the assumption that one user's variant does not alter another user's outcome — for example, treatment shoppers exhausting a fixed daily brand-reward budget so control shoppers see "offer sold out").

  4. Measure Experiment 2's impact on Experiment 1 with a 2x2 factorial analysis

    Inside the 4.5% of traffic enrolled in both tests (4 cells of 11,250 users), the overlap forms a 2x2 factorial design (an experiment layout testing all four combinations of (T1 in {0, 1}) x (T2 in {0, 1})).

    You can measure how E2 changes E1's impact using linear regression on the overlap users:

    Y = b0 + b1 * T1 + b2 * T2 + b3 * (T1 * T2) + error
    
      b0       = baseline conversion rate when both E1 and E2 are in control
      b1       = E1's lift when E2 is in control (old shelf order)
      b1 + b3  = E1's lift when E2 is in treatment (new shelf order)
      b3       = interaction effect: how much E2 changes E1's lift
    

    Equivalently, b3 is a difference-in-differences across the four cell conversion rates, which is easy to compute and explain directly in Python:

    import math
    
    
    def analyze_overlap_cells(cells):
        """cells[(t1, t2)] = (conversions, users). Returns conditional lifts, interaction, and SE."""
        rates = {}
        total_variance = 0.0
        for key, (conversions, users) in cells.items():
            rate = conversions / users
            rates[key] = rate
            # Each cell is an independent sample of users, so cell variances add
            total_variance += rate * (1.0 - rate) / users
    
        e1_in_old_shelves = rates[(1, 0)] - rates[(0, 0)]
        e1_in_new_shelves = rates[(1, 1)] - rates[(0, 1)]
        interaction = e1_in_new_shelves - e1_in_old_shelves
        se_interaction = math.sqrt(total_variance)
        return e1_in_old_shelves, e1_in_new_shelves, interaction, se_interaction
    
    
    overlap_cells = {
        (0, 0): (1125, 11250),  # 10.0% conversion
        (1, 0): (1215, 11250),  # 10.8% conversion -> E1 lifts +0.8 pts under old shelves
        (0, 1): (1170, 11250),  # 10.4% conversion
        (1, 1): (1215, 11250),  # 10.8% conversion -> E1 lifts +0.4 pts under new shelves
    }
    old_lift, new_lift, gamma_hat, se = analyze_overlap_cells(overlap_cells)
    # old_lift = +0.0080, new_lift = +0.0040, gamma_hat = -0.0040 (-0.40 pts), se = 0.0058 (0.58 pts)
    

    In this trace, E1 adds +0.80 percentage points under the old shelf order but only +0.40 points under the new shelf order, giving gamma_hat = -0.40 points with SE = 0.58 points (z = -0.69, 95% confidence interval [-1.53, +0.73] points). Because Var(interaction) sums four cell variances instead of two, a balanced interaction has 2x the standard error (and needs 4x the sample size) of a main effect on the same cells.

    Three practical ways to sharpen this analysis: - Report confidence intervals, never just "not significant." An interval of [-1.53, +0.73] points means the overlap is too small to rule out a meaningful negative interaction, NOT that gamma = 0. - Pool un-enrolled E2 users only after verifying equivalence. The 91% of E1 users outside E2 also see the old shelf order (227,500 users per E1 arm). If E2 has no special targeting filter or latency overhead (verified by checking that E2 control and Not in E2 match on baseline metrics), pooling them raises the old-shelf sample from 11,250 to 238,750 per E1 arm, cutting the interaction SE from 0.57 to 0.41 points (MDE drops from 1.58 to 1.15 points). If E2 uses custom eligibility gating, stick strictly to the four 11,250-user overlap cells. - Inspect mechanism metrics (such as whether E2 shifts clicks away from shelves where E1 made its biggest product changes) and, if both teams want to ship together, run a properly sized 2x2 confirmation test before full rollout.

  5. Choose metrics and guardrails for a shopping rewards app

    Organize metrics into three tiers before starting the experiment:

    • Primary decision metric (one per experiment, measured per exposed user): shopping conversion rate or attributed orders / verified receipt uploads per exposed shopper over the test window. Pick the single metric closest to durable business value.
    • Secondary diagnostic metrics (explain why the primary metric moved):
      • Item taps and cart-addition events per exposed shopper.
      • For E1 (within-shelf order): share of clicks landing in horizontal slots 1–3 of a shelf, and per-shelf click-through rate.
      • For E2 (shelf order): vertical rank of the first-clicked shelf, vertical scroll depth, and share of users reaching lower shelves.
    • Guardrail metrics (must stay within pre-agreed safety bounds):
      • 7-day retention and sessions per user, ensuring aggressive ranking changes do not fatigue shoppers.
      • Gross revenue or net reward margin per user, catching cases where ranking cheap impulse items boosts click volume while shrinking basket dollars.
      • Partner / sponsored shelf exposure, ensuring reordered shelves do not breach brand partner impression commitments.
      • App performance: p95 shelf-rendering latency and client crash rate.

    When computing ratio metrics like impression-level click-through rate (total clicks / total impressions), never plug total impressions into a textbook binomial formula: one active shopper generates dozens of correlated impressions, which makes naive p-values falsely tiny. Instead, compute variance at the user level using the delta method (a formula that derives the variance of SUM(clicks_u) / SUM(impressions_u) from user-level variances and covariance) or a user-level bootstrap (resampling whole users with replacement).

  6. Run statistical checks before reading any treatment lift

    Run a standard checklist of validity and precision checks before interpreting treatment effects:

    1. Sample ratio mismatch (SRM) on each test and on the 4 overlap cells. SRM occurs when the observed user split deviates from the intended ratio by more than random chance allows, signaling a routing, caching, or logging bug. Suppose E2 expects 45,000 / 45,000 users and observes 45,600 / 44,400: chi_square = (45600 - 45000)^2 / 45000 + (44400 - 45000)^2 / 45000 = 16.0 (p = 0.00006). Stop immediately and fix the pipeline before reading any metric.
    2. Cross-experiment independence check. Run a chi-square test of independence on the 2 x 2 table of (E1 arm) x (E2 arm) counts to confirm each cell holds ~25% of the overlap.
    3. Pre-period A/A balance. Confirm the assigned arms had statistically indistinguishable conversion and spend in the 2–4 weeks before exposure.
    4. Variance reduction via CUPED. CUPED (Controlled-experiment Using Pre-Experiment Data) adjusts each user's test-period outcome Y using their pre-experiment baseline X: Y_adj = Y - theta * (X - mean(X)) where theta = cov(X, Y) / var(X). If pre- and post-period conversions correlate at r = 0.6, CUPED cuts variance by r^2 = 36% — equivalent to getting 56% more traffic for free, which helps under-powered E2 the most.
    5. Multiple testing, peeking, and heavy-tail handling. Pre-commit to one primary metric; apply Benjamini-Hochberg false-discovery-rate correction (a p-value ranking adjustment that controls the expected share of false positives across many secondary metrics); wait for the full planned horizon (or use a formal sequential test rather than peeking daily); and winsorize (cap extreme top-1% outliers at a pre-set threshold) skewed metrics like revenue per user.
  7. Avoid interpretation traps when making the launch call

    Even when every statistical check passes, ranking experiments carry subtle interpretation traps:

    Cell (E1, E2)              Conversion rate    Lift vs (control, control)
    (control, control)              10.0%                    --
    (E1 treatment, control)         10.8%                 +0.8 pts
    (control, E2 treatment)         10.4%                 +0.4 pts
    (E1 treatment, E2 treatment)    10.8%                 +0.8 pts   (sub-additive: NOT +1.2 pts!)
    
    • Sub-additive combinations (1 + 1 < 2). In the table above, both teams see positive standalone results (+0.8 pts and +0.4 pts), yet shipping both delivers +0.8 pts — zero gain over shipping E1 alone, because both rankers surfaced the same popular items! Always make the launch call on the exact combination cell you intend to ship.
    • Shelf cannibalization and position bias. Moving Shelf A to position 1 steals attention from Shelf B below it: Shelf A's CTR surges even if total conversions per user stay flat (cannibalization). Likewise, comparing a product's CTR across arms mixes item appeal with screen slot (position bias). Base launch decisions strictly on per-user totals.
    • Novelty vs learning curves. Plot daily treatment lift by days since first exposure; habitual shoppers often click a rearranged screen more (or less) in week 1 before settling into a steady state.
    • Simpson's paradox during traffic ramps. Simpson's paradox happens when pooling data across time reverses the true within-period comparison — for example, ramping E2 from 2% on Tuesday to 9% on Saturday (when weekend conversion is naturally higher) inflates E2 treatment with weekend shoppers. Keep traffic splits constant during the analysis window, or compute lifts within each ramp phase and combine them with inverse-variance weights.
    • Clickbait proxy divergence. If product clicks jump +5% while purchases or receipt submissions stay at 0%, the new ranking surfaces eye-catching items shoppers do not actually buy — iterate on the ranking objective rather than shipping on clicks.

Intuition & how it works

Picture a supermarket testing two layout ideas in the same week: Experiment 1 (E1, 50% of shoppers) rearranges which products sit first inside each shelf, while Experiment 2 (E2, 9% of shoppers) rearranges which shelves sit closest to the store entrance. When the app assigns users to E1 and E2 using two independent hash salts (distinct strings mixed with user_id before hashing so the two coin flips are completely unrelated), the overlap is not a bug — it automatically forms a 2x2 factorial experiment (a four-cell grid covering (E1 control/treatment) x (E2 control/treatment)). Because E1 control and E1 treatment each contain the exact same 4.5% share of E2 treatment users, E2's standalone lift cancels out of E1's comparison, leaving both main-effect estimates unbiased.

Two naive instincts fail badly here. First, throwing away overlapping users wastes valuable sample size and blinds you to what happens when both ranking changes run together in production. Second, naively adding E1's headline lift and E2's headline lift (+0.8 + +0.4 = +1.2 percentage points) ignores interaction effects (synergy or cannibalization when both changes are active simultaneously) — for instance, if E1 promotes bestsellers to slot 1 of a shelf and E2 moves that shelf up or down, their gains can overlap instead of stacking.

Here is a concrete 4-cell trace on 45,000 shoppers enrolled in both experiments (11,250 per cell):

Cell (E1, E2)                  Users     Conversions    Rate     What it tells us
(0, 0) Old products, old shelf 11,250       1,125       10.0%    Baseline
(1, 0) New products, old shelf 11,250       1,215       10.8%    E1 lift under old shelves = +0.8 pts
(0, 1) Old products, new shelf 11,250       1,170       10.4%    E2 lift under old products = +0.4 pts
(1, 1) New products, new shelf 11,250       1,215       10.8%    E1 lift under new shelves = +0.4 pts

Interaction (difference-in-differences) = (+0.4 pts) - (+0.8 pts) = -0.4 pts
Combined lift if both ship              = 10.8% - 10.0%           = +0.8 pts (same as E1 alone!)

Key points

  • Independent overlap is unbiased in expectation. Orthogonal hashing ensures each arm of E1 gets the same 4.5% dose of E2 treatment, and each arm of E2 gets the same 25% dose of E1 treatment, so standalone lifts cancel out of each experiment's difference.
  • Overlap shifts external interpretation asymmetrically. With interaction gamma, E1's overall lift equals tau1 + 0.045 * gamma (almost purely E1's effect under today's shelf order), whereas E2's overall lift equals tau2 + 0.25 * gamma because 25% of E2 users sit inside E1 treatment. Neither headline number equals the combined rollout lift tau1 + tau2 + gamma.
  • True threats are correlated assignment, contamination, and shared budgets. Reusing one hash salt confounds the two tests; cross-device identity splits dilute effects toward zero; and shared reward caps violate SUTVA (the assumption that one user's treatment does not affect another user's outcome).
  • Measure E2's impact on E1 via the 2x2 interaction b3 = (p_11 - p_01) - (p_10 - p_00). Because Var(b3) adds four cell variances instead of two, a balanced interaction has 2x the standard error and needs 4x the sample size of a main effect on the same cells (MDE = 1.58 percentage points here vs 0.56 points for E2 and 0.24 points for E1).
  • Guard validity and precision systematically. Trigger on entering the shelf screen as a whole (never a single shelf), check sample ratio mismatch (SRM) with a chi-square test per experiment and across the 4 cells, apply CUPED (variance reduction using pre-experiment user baselines), analyze ratio metrics at the user level via the delta method or bootstrap, and judge success on per-user shopping conversions alongside revenue, retention, partner-exposure, and latency guardrails.

Common mistakes

  • Dropping overlapping users from the analysis. Excluding the 4.5% overlap throws away statistical power and destroys the exact 2x2 cell ((1, 1)) needed to see whether both changes work together.
  • Adding the two standalone lifts to forecast a joint launch. When two rankers surface the same popular products, their combined lift is often much smaller than tau1 + tau2 (or even negative if they clash).
  • Treating "interaction p > 0.05" as proof of zero interaction. With 11,250 users per overlap cell, the interaction test cannot reliably detect anything smaller than 1.58 percentage points; always inspect the confidence interval.
  • Reusing the same hash salt across experiments. Hashing user_id with an identical seed maps the 9% of E2 into a deterministic slice of E1 instead of spreading it evenly across E1 control and treatment.
  • Using impression-level binomial standard errors for CTR. One user generates many correlated shelf impressions, making naive standard errors artificially tiny and inflating false positives.
  • Judging E2 by individual shelf CTR or triggering on a specific shelf. Moving a shelf to the top boosts its clicks by cannibalizing lower shelves and changes which shoppers reach it; only per-user totals on all shelf-screen visitors give an apples-to-apples comparison.
  • Ramping traffic mid-experiment without stratifying by phase. Changing E2 from 2% on weekdays to 9% on weekends creates Simpson's paradox (pooling unequal time slices biases the treatment arm toward high-converting weekend traffic).

Follow-up questions

  • When should two ranking experiments be isolated in mutually exclusive traffic buckets rather than allowed to overlap? Mutual exclusion makes sense when two changes cannot technically coexist in the UI, when engineering expects a severe negative interaction that could break the user experience (such as crashes or empty shelves), or when only one of the two candidates could ever ship. The trade-off is smaller available traffic pools (50% + 9% = 59% consumed linearly) and zero direct data on the (treatment, treatment) combination. When both ranking improvements could plausibly ship together, independent overlap with an explicit 2x2 check is strictly more informative.
  • What sample size would a dedicated 2x2 factorial test need to detect a 0.4-percentage-point interaction effect? With n users in each of the 4 cells and baseline conversion p = 10%, the interaction's standard error is sqrt(4 * p * (1 - p) / n). Solving (1.96 + 0.84) * sqrt(4 * 0.09 / n) = 0.004 gives n = 4 * 0.09 * (2.80 / 0.004)^2 = 176,400 users per cell, or 705,600 exposed users total (4x the 176,400 total users required to detect a 0.4-point main effect). Because that sample requirement is steep, teams combine CUPED pre-period adjustment with diagnostic exposure metrics (like top-shelf click share) and reserve full-size interaction tests for launches where shipping both is on the table.
  • How would you act if Experiment 1 boosts item clicks by 6% while completed orders and receipt uploads stay flat? Hold back the launch and trust the pre-registered primary conversion metric, because clicks are only an upstream proxy metric (a fast-moving intermediate signal that imperfectly predicts business value). Diagnose why clicks failed to convert: check whether E1 promoted cheap/out-of-stock eye-candy items, whether add-to-cart rate per click dropped, or whether shoppers clicked more items only because the first item was worse and forced extra searching. Use that finding to retrain or re-weight E1's ranking score toward predicted purchase or receipt value rather than raw click probability.

Follow-up questions

Similar questions

More Fetch Rewards interview questions

All 4 Fetch Rewards questions →