Diagnosing a Spike in Warm Food Delivery Complaints
Statistics & ExperimentsModel answerLast updated
Investigate a rise in temperature complaints across the delivery funnel, separate mix shifts from operational decay, and design a marketplace-safe experiment to test a fix.
Context
Over the last six weeks, a food delivery platform has seen a 28% jump in customer contacts citing food that arrived cold or only lukewarm, concentrated in one large city. The merchant operations and logistics teams are split on the cause: some believe delivery routing has deteriorated; others suspect restaurants are sending food out too early; a few think the complaints themselves are a statistical artifact.
You are the data scientist embedded on the Fulfillment Quality team. Your job is to run the investigation end-to-end and propose a testable intervention.
Part 1 — Measurement Integrity
-
Construct a primary metric for "temperature failure rate" that draws on support contacts, refund requests, and post-delivery ratings. What systematic biases arise when support tickets are used as the sole numerator, and how would you build a corrected or proxy measure that tracks real dissatisfaction more reliably?
-
What signals from the order lifecycle would help you distinguish actual physical cooling (food genuinely arriving cold) from increased willingness to complain (the same food quality generating more contacts)? Be specific about telemetry sources and tests you would run.
Part 2 — Decomposition & Root Cause
You have per-order timestamps: order_placed, order_confirmed_by_merchant, dasher_assigned, dasher_arrived_at_store, order_picked_up, and order_delivered.
-
Segment the fulfillment timeline into meaningful intervals and reason through which segment carries the most thermal risk. Justify your answer — raw correlation with the complaint signal is not sufficient.
-
The platform-wide temperature complaint rate rose from 1.2% to 1.54% of completed orders, a +0.34 percentage point increase. Walk through a mix-shift decomposition that partitions this change into:
- A composition effect — the order mix has shifted toward inherently riskier order types (e.g., more stacked deliveries, longer distances, colder ambient temperatures, cuisine types that cool quickly).
- A performance effect — complaint rates have risen within order types that have not changed in share.
Show the decomposition formula, explain how you would attribute the composition effect to individual factors, and describe what a large performance effect would imply operationally.
Part 3 — Experiment Design & Guardrails
The logistics team wants to test tightening the maximum allowed courier travel distance and restricting order stacking for cuisines prone to rapid cooling.
-
State the hypothesis formally. Choose a randomization unit and justify it — specifically address why customer-level or courier-level randomization creates interference problems in a shared-supply marketplace.
-
Define your primary success metric, at least three secondary metrics, and the guardrail conditions you would place on customers, couriers, and restaurants. What thresholds would trigger a pause or rollback?
Hints
Hint 1
Before investigating operations, check for reporting artifacts first — a new refund flow, a UI prompt, or a tagger change near the inflection date can produce a complaint spike with zero underlying quality change. Rule that out before touching any funnel data.
Hint 2
Food starts cooling when it leaves the kitchen, not when the order is placed. The thermal clock that matters is time-from-ready, not time-from-placed. Think about which timestamp events proxy for 'food ready' and where the exposure accumulates most in a stacked delivery.
Hint 3
Customer-level A/B randomization fails here because courier supply is pooled. Removing stacking for treated orders uses up more couriers, which degrades availability for control orders — the control group is contaminated and your measured lift is understated. Think about what randomization unit breaks that interference.
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
Approach Overview
This problem tests three distinct skills in sequence: measurement skepticism, structured causal decomposition, and marketplace-aware experiment design. A strong answer works through them in that order, because each step conditions the next — you should not design an experiment around a metric you have not yet validated.
Part 1 — Measurement Integrity
1.1 Constructing the metric
Temperature Failure Rate (TFR):
TFR = (delivered orders with ≥ 1 temperature signal) / (delivered orders)
A "temperature signal" is any one of:
- A support contact tagged as cold, lukewarm, or soggy.
- A refund or credit request citing temperature as the reason.
- A post-delivery rating of ≤ 3 stars with a temperature keyword in free text, or with the temperature low-rating tag selected.
Deduplication is important: one order can trigger all three signals, but it counts once in the numerator.
Biases of tickets-only measurement:
- Severe under-reporting. Most dissatisfied customers do not contact support. Tickets are a lower bound, and the bound is not stable over time.
- Propensity drift. Reporting rates shift when the app adds a new issue-reporting entry point, when refund generosity increases (making it worth the effort to complain), or when the automated tagger model is retrained. A 28% ticket jump can be entirely explained by a UI change or a policy shift.
- Selection confounding. High-tenure or subscription customers complain at different rates. If their share in the market changed, raw ticket counts move even if quality held constant.
- Easy-to-claim nature of temperature. Unlike missing items, cold food cannot be verified remotely, so it attracts strategic refund requests.
Corrected approach: Run a lightweight post-delivery survey on a random 1–2% sample of completed orders, asking a simple temperature satisfaction question. Use this to estimate the true incidence and the implied reporting propensity — P(ticket | cold experience) — by segment. That ratio can reweight the ticket numerator or serve as a direct ground-truth benchmark.
1.2 Physical cooling vs. propensity to complain
Reporting artifact checks first:
- Scan for product releases, refund policy changes, or tagger model updates near the inflection date. If another complaint category (missing items, wrong order) also jumped ~28% in the same window, the cause is propensity, not operations.
- Check whether the fraction of cold complaints that received an auto-refund changed — a more generous refund policy shifts the incentive to report.
Physical cooling signals:
- Food-at-rest time. Estimate time from food ready (use merchant tablet "order ready" events where instrumented, otherwise use predicted prep time) to pickup. This is the shelf-wait exposure.
- Courier GPS traces. Detour distance, stop count, and order position within a batch all add cooling time. The first pickup in a two-order stack is exposed for the full delivery window of both drops.
- Dose-response stability. Plot TFR against food-at-rest minutes by period. If the curve shifts upward — the same 20-minute wait produces more complaints in the post period than the pre period — propensity drift is likely. If the curve is stable but the distribution of wait times shifted rightward, the problem is operational.
Part 2 — Decomposition & Root Cause
2.1 Funnel segmentation and thermal risk
| Segment | Events | Thermal exposure |
|---|---|---|
| Merchant confirmation lag | placed → confirmed | Negligible; food not yet cooking |
| Assignment latency | confirmed → assigned | Indirect; affects whether courier arrives before food is ready |
| Courier transit to store | assigned → arrived_at_store | Low if courier arrives after food; high if courier arrives before food is ready and waits |
| Store wait | arrived_at_store → picked_up | Low if courier waits for food; high if food was sitting ready before courier arrived |
| Delivery transit | picked_up → delivered | Highest — food is in the bag and cooling; batching adds detours |
The key insight: food begins cooling when it leaves the kitchen, not when the order is placed. The total thermal exposure is approximately:
exposure = max(0, picked_up − food_ready) + (delivered − picked_up)
For stacked orders, the first-picked item is exposed for the full second delivery leg in addition to its own. This makes pickup-to-delivery time on batched orders the dominant risk factor.
Validate with a logistic regression of the temperature signal on all segment durations jointly, controlling for cuisine type, distance, and ambient temperature. Raw segment correlations are insufficient because durations are collinear — a slow assignment will compress the apparent store wait time.
2.2 Mix-shift decomposition
Define cells k using exogenous covariates: batched vs. single, distance band (short/medium/long), cuisine thermal-loss class (high/medium/low), and ambient temperature band. Operational durations belong on the right-hand side of a regression, not in the cell definition — using them as cells conflates composition with performance.
Kitagawa decomposition:
Let w = cell share and r = cell complaint rate, with subscripts 0 (pre) and 1 (post).
ΔR = Σₖ (w₁ₖ − w₀ₖ) · (r₀ₖ + r₁ₖ)/2 ← composition effect
+ Σₖ (r₁ₖ − r₀ₖ) · (w₀ₖ + w₁ₖ)/2 ← performance effect
The two terms sum exactly to +0.34 pp. A realistic result might be 0.10 pp composition (more batching and colder ambient weather) and 0.24 pp performance (rates worsened within order types).
Attributing the composition effect to individual factors requires care because the ordering matters in sequential decomposition. Use Shapley-averaged marginal contributions — compute each covariate's average marginal contribution across all orderings — to get a defensible attribution.
What a large performance effect implies: Rates worsening within unchanged order types suggests either longer operational durations (the endowment channel in an Oaxaca-Blinder framing) or the same durations producing more complaints (a propensity or packaging quality channel). Fit segment durations as regressors and decompose further:
ΔR = (X̄₁ − X̄₀)·β₀ ← endowment: longer waits and transit
+ X̄₁·(β₁ − β₀) ← coefficient: same minutes, more complaints
A large coefficient term with stable durations points back to propensity drift or degraded insulation (e.g., bag compliance drop). A large endowment term points to genuine operational slowdown.
Part 3 — Experiment Design & Guardrails
3.1 Hypothesis and randomization unit
Hypothesis:
Tightening maximum courier travel distance and restricting order stacking for high thermal-loss cuisines reduces TFR (H₁: ΔTFR < 0) without materially reducing completed order volume, courier utilization, or average delivery time.
Randomization unit: geographic sub-market × time window (switchback design)
Divide the city into sub-markets (e.g., demand zones) and randomize treatment assignment in 30–60 minute blocks, balanced across hours of day and days of week. Holdout buffers between windows absorb carryover effects. Orders spanning a window boundary are excluded.
Why not customer-level? Courier supply is pooled across all customers. Removing stacking for treated customers consumes more courier capacity per order, raising wait times and reducing availability for control customers. The control arm is contaminated, and the measured effect understates the true treatment effect. This is a SUTVA violation.
Why not courier-level? Treated and control couriers compete for the same order queue. A treated courier who cannot stack takes a single order and then sits idle, distorting the supply available to control orders. Interference persists.
The switchback design lets entire sub-markets flip together, which largely eliminates cross-arm spillover within a window, and it captures equilibrium supply effects — surge pricing, courier availability — that a partial rollout would miss.
3.2 Metrics and guardrails
Primary metric: Temperature Failure Rate (TFR), as defined above.
Secondary metrics:
- Completed orders per hour per sub-market (volume health).
- Average end-to-end delivery time (customer experience).
- Courier utilization rate and average earnings per hour (supply-side health).
- Restaurant order cancellation rate (merchant health).
Guardrail conditions:
| Stakeholder | Guardrail | Threshold |
|---|---|---|
| Customer | Delivery time | No more than +2 min increase on average |
| Courier | Earnings per active hour | No more than −3% decline |
| Merchant | Cancellation rate | No increase above pre-experiment baseline |
| Platform | Completed order volume | No more than −1% decline |
Any guardrail breach triggers an automatic pause and manual review before the experiment continues. The primary success condition is a statistically significant reduction in TFR (α = 0.05, 80% power) with all guardrails intact.
Common mistakes to avoid: Not accounting for the ambient-temperature seasonal trend as a time-varying confounder in the switchback analysis; using support tickets as the raw metric without checking for propensity drift first; and choosing customer-level randomization without acknowledging the supply interference problem.