Design an Experiment to Evaluate a Cargo-Bike Courier Pilot
Statistics & ExperimentsModel answerLast updated
Design an end-to-end experimentation framework—metrics, randomization strategy, spillover detection, and a decision rule—for a bike courier program in dense urban zones.
Background
A last-mile delivery platform is piloting a cargo-bike courier program in dense urban cores (think: downtown grids where parking is scarce and short-distance orders dominate). Advocates believe bike couriers can cut pickup delays and reduce per-delivery cost on short runs by bypassing parking entirely. Critics raise concerns about weight/basket-size limits, slower performance on longer routes, weather exposure, and earnings pressure on existing motorized couriers who rely on those same short, high-tip orders.
You are the senior data scientist responsible for designing the measurement and experimentation framework that will determine whether to scale the program citywide.
What you are asked to do
Part 1 — Measuring Pickup Delay
- How would you operationally define and measure pickup dwell time using GPS telemetry and courier app status events? What sources of measurement error are most dangerous, and why?
- Propose a metric architecture: 1–2 primary metrics, 2–3 guardrail metrics, and at least one ecosystem metric that tracks supply-side health across both bike and motorized couriers.
Part 2 — Experimental Design and Interference
- Explain concretely why simple courier-level or consumer-level randomization violates SUTVA in a shared dispatch marketplace.
- Compare a spatial cluster randomization approach (e.g., geohash or submarket clusters) with a time-based switchback design (alternating treatment/control windows within the same zone). Which would you recommend for dense urban cores, and under what conditions would you use both?
- How would you detect whether bike couriers cherry-pick short, high-tip orders—leaving longer, less profitable deliveries to motorized couriers—and quantify how much of any observed effect is a real efficiency gain versus a redistribution of favorable orders?
Part 3 — Decision Rule
The experiment returns these top-line results:
| Metric | Result |
|---|---|
| Pickup dwell time | −3 minutes (treatment vs. control) |
| Cost per delivery, orders < 1.5 miles | −4% |
| Motorized courier utilization | −6% |
| Merchant cancellation rate, large orders | +1.5 percentage points |
Construct a concrete Launch / Iterate / Scrap decision rule that weighs these trade-offs. What additional context would change your recommendation?
Hints
Hint 1
Pickup dwell time measured purely from courier button presses is biased: a car courier typically presses 'Arrived' only after finding parking, while a bike courier presses it immediately. Design your geofence-based definition around GPS entry into the pickup radius rather than the status event, then cross-validate against merchant handoff timestamps to check consistency across vehicle types.
Hint 2
Standard A/B randomization assumes each unit's outcome is unaffected by other units' treatment assignment. In a shared dispatch pool, every short order a treated bike courier accepts is one fewer order available to a control motorized courier. That contamination flows in both directions, making naive treatment-vs-control differences misleading. Ask yourself: what is the right unit of randomization…
Hint 3
For the decision rule, resist collapsing everything into a single weighted score before you understand the mechanism behind each number. A 6% drop in motorized courier utilization is alarming if earnings per hour also fell (churn risk), but may actually be slack capacity if hourly earnings held steady. Diagnose each guardrail before pricing it.
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
What a strong answer covers
The question tests three distinct skills: operational measurement design, marketplace experimentation theory, and the ability to convert ambiguous empirical results into a defensible business recommendation. A common failure is to treat this as three unrelated sub-questions rather than a coherent framework where each layer informs the next.
Part 1 — Metric Architecture and Dwell-Time Measurement
Defining pickup dwell time correctly
The naive definition—time between the courier pressing "Arrived at Pickup" and pressing "Order Collected"—has a critical flaw: car couriers typically press "Arrived" after finding parking, not on arrival. Bike couriers press it immediately. This creates a systematic measurement difference that makes bikes look faster on the button-press metric even before any real operational advantage exists.
A more defensible definition uses GPS:
- Clock starts when the courier's GPS trace first enters a ~150 m geofence around the pickup location.
- Clock ends when the courier exits that geofence with the order in a collected state.
Decompose the interval into three sub-components: approach-to-stationary, in-store wait (from stationary to merchant handoff), and exit. Use three data sources and reconcile them: app status events, merchant-tablet handoff timestamps, and phone motion/accelerometer state as a tiebreaker when presses are missing or implausible.
Key measurement risks:
| Error source | Effect | Mitigation |
|---|---|---|
| GPS multipath in urban canyons | 50–200 m drift, false geofence events | Require ≥30 s inside geofence; snap to building footprint |
| Indoor signal loss (high-rises) | Missing pings during in-store wait | Fall back to merchant handoff timestamp |
| Differential prompt behavior by vehicle type | Bike couriers press more accurately and promptly | Validate the geofence definition on a hand-labeled holdout, stratified by vehicle type |
The critical principle: measurement error correlated with treatment assignment creates bias, not just variance. Validate the definition produces equivalent error rates across vehicle types before running the experiment.
Metric architecture
Primary metrics (these are the decision levers):
- Cost per delivery on eligible orders (courier pay + incentives), reported at zone level.
- Consumer order-to-door time.
Dwell time is a mechanism metric—useful for explaining results, not for deciding. If dwell time falls but order-to-door time doesn't, the operational story has a gap worth investigating.
Guardrail metrics (pre-register bounds before launch):
- Merchant and consumer cancellation rate, segmented by basket size and order distance.
- Late-delivery rate and associated refund/credit spend.
- Consumer satisfaction scores or low-rating rate.
Ecosystem metric (supply-side health, reported separately for bike and motorized couriers):
- Earnings per active hour, utilization (on-trip time / online time), offer acceptance rate, and 4-week supply retention. This is the metric most likely to reveal long-run harm that a short experiment misses.
Part 2 — Experimental Design and Interference
Why Bernoulli randomization fails
Car and bike couriers draw from the same real-time dispatch queue. If you randomize at the courier level, every short order a treated bike courier accepts is one fewer order available to a control motorized courier—their outcomes are directly coupled. Randomizing at the consumer level fails for the same reason: consumers share supply, so treatment-group consumers receive a different supply mix than they would in isolation.
The result is that the naive treatment-minus-control estimate double-counts: treatment gains are partly control losses. This usually makes the program appear more valuable than it is.
Cluster vs. switchback design
| Dimension | Spatial cluster | Time switchback |
|---|---|---|
| Interference | Leaks at zone boundaries as couriers cross | Contained within zone; risk is window-to-window carryover |
| Statistical power | Limited: ~10–20 dense urban cores, highly heterogeneous | High: each zone is its own control, many windows per zone |
| What it captures | Long-run supply equilibrium (churn, earnings drift, recruiting) | Short-run dispatch and fulfillment effects |
| Main risk | Severe imbalance with few clusters | Carryover from orders in flight that span window boundaries |
Recommendation: a two-layer design.
-
Primary layer — switchback on dispatch policy. Alternate 60–90 minute treatment (bike-eligible routing active) and control (motorized-only for that zone) windows, stratified by day-of-week and daypart. With typical delivery cycles of 30–40 minutes, most orders resolve within a window; drop a ~30-minute burn-in at each window transition to reduce carryover. Analyze at the zone × window level using cluster-robust standard errors or randomization inference. This delivers adequate power within a few weeks in high-density zones.
-
Secondary layer — geo holdout with synthetic control over 8–12 weeks. This is necessary because a switchback cannot measure whether motorized couriers churn over weeks in response to a worse order mix, or whether bike courier supply scales as intended. A switchback runs at the dispatch-decision level; supply-side equilibrium operates on a much longer clock.
Detecting cherry-picking
Cherry-picking occurs when bike couriers preferentially accept short, high-tip, high-density orders and leave longer, less profitable runs to motorized couriers. To measure it:
- Compare the order mix offered to vs. accepted by bike couriers along distance, tip per mile, and earnings per mile dimensions. A large acceptance gap on short high-tip orders is direct evidence.
- Compare the order mix assigned to motorized couriers in treatment vs. control windows. A rightward shift in distance distribution and lower earnings per mile in treatment windows—even before any operational efficiency effect—confirms redistribution.
- Report effects in three components: the direct effect on bike-served orders, the indirect effect on motorized-courier orders within the same windows, and the total market-level effect. Only the total effect is decision-relevant; the decomposition explains the mechanism.
Part 3 — Decision Rule
Before scoring the numbers, diagnose the mechanism behind each one.
−3 min dwell, −4% cost per delivery on short orders: Confirm the dwell reduction flows through to consumer order-to-door time, not just the internal metric. If it does, estimate the delivery-time-to-retention elasticity from historical data (a rough prior: ~0.5% order volume uplift per minute saved on sub-1.5-mile orders). Cost savings of ~4% on ~40% of orders produces roughly $0.10–0.12 per order in gross margin contribution.
−6% motorized courier utilization: This is the most ambiguous number. Two very different interpretations:
- If earnings per active hour held steady, the utilization drop is idle slack—a signal that motorized supply can be right-sized in dense cores, reducing incentive spend. This is a positive.
- If earnings per hour also fell, couriers are earning less per shift. That creates churn risk. Price it as the incremental incentive required to hold supply, and check 4-week retention in the geo holdout.
+1.5 pp merchant cancellation rate on large orders: First confirm units (percentage points, not relative %). If large orders represent ~10% of volume, this affects 0.0015 cancellations per total order. At a typical large-basket order value and take rate, the cost is roughly $0.03–0.05 per order, but merchant relationship damage and repeat-order loss compound over time—worth a multiplier of 1.5–2x.
Decision rule:
- Launch if: (a) the 95% CI lower bound on net contribution per order is positive after netting out the cancellation cost, and (b) all guardrail metrics are within pre-registered tolerances—suggested thresholds: cancellation rate increase < +0.5 pp, motorized courier earnings per hour change > −3%.
- Iterate if: net contribution is positive but a guardrail is breached, or the cancellation signal is concentrated in a specific merchant or basket-size segment that could be addressed by routing rules (e.g., suppress bike assignment for orders above a weight threshold).
- Scrap if: total market-level cost per delivery does not improve (gains on short orders are fully offset by redistribution losses), or motorized courier retention data from the geo holdout shows a statistically significant churn increase.
What would change the recommendation: evidence that the cancellation increase is driven by a specific basket-size or distance threshold that a routing constraint could fix; motorized courier earnings holding flat despite lower utilization; or bike supply failing to scale beyond a small enthusiast cohort in adverse weather months.