Design an Experiment for a Cargo-Bike Last-Mile Delivery Program
Statistics & ExperimentsModel answerLast updated
Design an A/B test for a bike-only dispatch pilot, covering metric selection, randomization unit trade-offs, and how shared courier supply creates interference.
Scenario
A last-mile logistics platform is piloting a program that restricts deliveries in a dense downtown corridor to bicycle couriers only. The motivation is straightforward: car couriers in that area spend a disproportionate share of each trip searching for parking or waiting in loading zones, inflating the time customers actually wait. You are the analyst responsible for measuring whether the program works.
The platform operates a two-sided marketplace: customers place orders, and couriers — some with cars, some with bikes — self-select into shifts. The pilot applies only to a single high-density neighborhood. Outside that area, the regular mixed-fleet dispatch rules remain in effect.
What you are asked to do
1. Pick your metrics. Choose one primary metric that best captures whether the pilot is achieving its goal. Then name two guardrail metrics that would alert you if the pilot is damaging other parts of the marketplace. For each metric, briefly explain what it measures and why it matters here.
2. Choose a randomization strategy. Walk through the trade-offs of three possible assignment units:
- Individual customer accounts
- Individual courier accounts
- Geographic zones or time-based blocks
Recommend one approach and justify it. Be explicit about what experiment design you would actually run and why.
3. Address supply-side interference. Bike couriers and car couriers draw from the same order queue. Explain concretely how that shared pool can corrupt your experiment results. What happens to the control group's measurements when you treat only part of the supply? How would you adjust the design or analysis to account for it?
Constraints to keep in mind
- The pilot zone is geographically bounded — one urban neighborhood.
- Courier fleet composition (car vs. bike) is determined by what the courier already owns; you cannot randomly assign courier type.
- Assume you have full telemetry: GPS traces, order timestamps at each stage, courier earnings records, and customer app data.
Hints
Hint 1
Your primary metric should reflect what the *customer* experiences across all orders in the zone, not just how fast bike couriers complete their individual trips. Think about why those two things can diverge.
Hint 2
A classic A/B test assigns treatment to independent units. Ask yourself whether any pair of randomization units here truly share no couriers, no orders, and no dispatch queue — and what that implies for which design is viable.
Hint 3
When one group in your experiment takes trips the other group would have taken, bias flows in a specific direction. Work out which group looks artificially better and which looks artificially worse, then ask what design choice removes that problem entirely.
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
What a strong answer covers
This is a two-sided marketplace experiment, and that single fact drives every decision. Treated and control units share a courier pool, which breaks the stable unit treatment value assumption (SUTVA) underlying standard A/B testing. A strong answer names that problem early, then builds the metric choices, randomization design, and interference mitigations around it.
Step 1: Metric definition
Primary metric: mean end-to-end delivery time for all orders placed in the pilot zone.
Measure from order placement to confirmed drop-off, for on-demand orders only (exclude scheduled deliveries, which have slack built in). Aggregate to the randomization unit — a zone-period or time block — not to individual orders.
Why not bike-courier trip duration? Because that metric is selected and displaced. Bike couriers, restricted to a dense zone, naturally get the shortest, most parking-intensive trips. Their times will look great regardless of whether the program creates real market-level speed improvements. The customer-facing end-to-end time across all couriers is what the business actually cares about. Report a breakdown — time to courier assignment, courier travel to merchant, wait at pickup, travel to customer — as diagnostics, not as the primary metric. Track p90 delivery time as a secondary metric; a mean improvement that widens the tail is not a win.
Guardrail 1: car-courier earnings per active hour (EPAH) in and adjacent to the pilot zone.
If bikes skim the short, dense, high-volume trips, car couriers are left with longer, lower-frequency routes. Their EPAH falls even though nothing changed in how the platform pays them. A sustained drop signals a supply-side harm that can drive car couriers off the platform — exactly the kind of damage that would degrade the marketplace once the pilot ends. Pair EPAH with short-term car-courier retention (days active per week).
Guardrail 2: order fulfillment rate — specifically, the share of placed orders that are unassigned after N minutes, plus the late-delivery rate.
Bike couriers may decline long trips or orders near the zone boundary. If bike supply is insufficient for peak demand, orders go unfulfilled even while average times improve. This metric catches supply imbalance before it becomes a customer-facing crisis.
Step 2: Randomization strategy
| Unit | Problem |
|---|---|
| Customer | The treatment is supply-side. Treated and control customers draw from the same dispatch queue simultaneously. SUTVA is violated immediately. |
| Courier | Bike ownership is self-selected, so true random assignment is impossible. Even if it were possible, treated and control couriers would compete for the same orders in the same zone. |
| Geographic zone | Contains most spillover within the zone. Matches how a real rollout would work. Low unit count and low statistical power are real drawbacks. |
Recommended design: a switchback experiment within the pilot neighborhood.
Randomly toggle bike-priority dispatch on or off in time blocks of one to two hours, stratified by day-of-week and daypart. Run at least three to four weeks to cover weekend/weekday variation and weather patterns.
The key property of a switchback is that treatment and control never coexist in the same dispatch pool at the same instant. That removes within-period cross-unit interference by design. After each toggle, exclude orders placed during a 15–30 minute burn-in window; in-flight orders from the previous period carry over and contaminate measurements.
The estimand is the total market-level effect — the number a launch decision should actually be based on. Cluster standard errors at the block level (one block = one time window). Never analyze at the order level; doing so inflates your effective sample size by 10–100x and produces false confidence.
Complement with a geo/synthetic control analysis. A switchback cannot capture slow-moving effects: courier supply composition over weeks, customer habit formation, or long-run retention. Build a synthetic control from demographically and operationally similar dense neighborhoods, compare pre/post trends with difference-in-differences, and use it to sanity-check the switchback estimate.
Step 3: Interference and spillover
The mechanism, concretely. In a courier-level A/B test, bike couriers (treated) receive the short, parking-heavy trips they are best suited for. Car couriers (control) are left with the residual: longer trips, worse batching, lower order frequency. Result: treated units look artificially fast and control units look artificially slow. The measured difference overstates the true effect. The same contamination flows into the earnings guardrail — car-courier EPAH drops not because the pilot harmed them, but because the experiment design redirected orders away from them.
The substitution question. At the market level, the question is not "are bike trips faster in isolation?" It is whether total deliveries per courier-hour across the full fleet improves once displacement is accounted for. If bikes replace car trips one-for-one with no net efficiency gain, car couriers lose volume and marketplace capacity is unchanged.
Mitigations:
- Randomize at the market level (switchback or geo). The estimand becomes the total effect, which is what matters for a go/no-go decision.
- Buffer zones. Drop orders placed within a few blocks of the neighborhood boundary, where couriers routinely cross in and out.
- Measure both sides. Report bike-courier and car-courier outcomes separately, plus the pooled metric (deliveries per courier-hour across all couriers in the zone).
- Quantify leakage. Compare car-courier metrics in immediately adjacent zones against more distant control zones. A significant gap signals spillover and lets you bound the bias.
Common mistakes
- Proposing a user-level or courier-level A/B test without addressing the shared dispatch pool.
- Using bike-trip duration as the primary metric — it conflates the treatment effect with selection bias (bikes get easier trips by design).
- Analyzing at the order level after a switchback or geo assignment — this produces drastically anti-conservative p-values.
- Ignoring carryover between switchback periods; in-flight orders must be excluded from each new period's measurement window.
- Treating one treated neighborhood versus one control neighborhood as a well-powered experiment — that is two observations at the unit of randomization.
Follow-up: delivery times improve, but car-courier retention drops
Put both outcomes in a common long-run currency. Faster deliveries increase customer conversion and order frequency — quantifiable from historical elasticity. Lost car supply raises future latency (bikes can't cover long trips or suburbs), increases incentive spend to attract supply, and creates coverage gaps. Diagnose before deciding: are car couriers converting to bikes (total supply stable, benign) or leaving the platform (harmful)? Check total active courier hours, not just headcount. Pre-register a decision rule — for example, ship only if car-courier EPAH declines by no more than X% — so the threshold is set before results are unblinded. If a real trade-off exists, explore mitigations such as dispatch rules that reserve long-distance orders for car couriers or targeted retention incentives.