Design a Switchback Test for a New Order Batching Policy
Last updated: November 29, 2026
Quick Overview
Swiggy wants to test a dispatch policy that batches two nearby orders onto one rider more aggressively. Explain why a user-level A/B test is biased here, and design a switchback experiment including randomization unit, metrics, analysis and how you would size it.
Swiggy
November 29, 20260
0
0 solved
Swiggy wants to test a dispatch policy that batches two nearby orders onto one rider more aggressively. Explain why a user-level A/B test is biased here, and design a switchback experiment including randomization unit, metrics, analysis and how you would size it.
Dispatch changes affect a shared pool of riders, so treatment and control users interfere through supply. Swiggy data scientists working on logistics are expected to know switchback designs, carryover effects and cluster-level inference, and the onsite probes all three.
What the Interviewer Expects
- Explains interference: treated orders consume or free riders that control orders also use
- Chooses region by time-window units and justifies the window length
- Handles carryover with burn-in periods or dropping boundary orders
- Defines primary, guardrail and rider-side metrics
- Analyzes at the unit level with cluster-robust errors
- Sizes the test using between-unit variance, not order counts
Key Topics to Cover
How to Approach This
- Define success metrics carefully. A good metric is measurable, actionable, and aligned with business goals.
- Run experiments long enough to account for novelty effects and weekly seasonality.
- Use funnel analysis to identify where users drop off for maximum optimization impact.
- Segment results by key dimensions (platform, country, user cohort) to catch hidden patterns.
- Consider network effects and interference between treatment and control groups.
Possible Follow-up Questions
- How would you choose between 30-minute and 2-hour windows?
- What if the policy's effect differs strongly between peak and off-peak hours?
- How would you detect carryover from the data itself?
- Leadership wants a result in one week. What do you trade off?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Browse Analytics QuestionsSample Answer
Clarify
Policy: allow batching when two orders' restaurants and drops are close and the added time is under a threshold. Goal: more orders per rider hour without hurting delivery time or food quality. Populat...
Approach
A user-level split fails because the policy changes how riders are used. If treatment batches more, it frees riders who then serve control users faster, so control looks better than it would without t...