Investigate Warm-Food Failures and Decide on a Fix
Statistics & ExperimentsModel answerLast updated
Diagnose why orders arrive cold, define measurable success, design a causal evaluation, and build a principled launch decision framework for a delivery marketplace.
You work as a data scientist at a three-sided delivery marketplace connecting customers, restaurants, and drivers. Recently, customer feedback has surfaced a recurring complaint: food is arriving cold. The product team has developed an intervention they believe will reduce this, and they want your recommendation on whether to roll it out company-wide.
Walk through your full analytical process: how you would measure the problem, what metrics you would track, how you would evaluate the intervention's effect, and how you would ultimately make the launch call. Be specific about what data you would look at and what comparisons you would make. If a clean randomized experiment is not possible, propose a credible fallback.
Setup and Constraints
- The marketplace has three stakeholders: customers, restaurants, and drivers. A solution that materially harms one side to benefit another does not count as a win.
- "Food arrived cold" is not yet a well-defined metric. You will need to propose a working definition — and be upfront about its weaknesses.
- The intervention is intentionally left unspecified. Part of your answer should explain how the experimental design changes depending on whether the fix operates at the order, driver, restaurant, or market level.
- Available data includes: order event logs, promised vs. actual delivery times, customer support contacts, refunds, ratings, restaurant and driver identifiers, geographic data, item-level attributes, and experiment exposure logs when a test is running.
- Complaints and refunds are not clean ground-truth labels for temperature. Treat them as noisy signals.
Questions Worth Asking Before Starting
- What exactly is the intervention, and what is the natural unit at which it can be assigned?
- Which segments — cuisine types, delivery distances, cities, order times — show the worst rates?
- Is there a direct temperature measurement anywhere, or only indirect signals like refunds and ratings?
- Is the primary goal fewer cold-food incidents, better retention, lower support costs, or some combination?
- What is the decision deadline, the minimum effect that would justify the cost, and the observation window?
Part 1: Turn "Cold Food" into a Measurable Problem
Describe how you would construct a workable definition for a cold-food incident from available data. Then explain what analyses you would run to estimate how widespread the problem is, where it is concentrated, and whether what you are seeing is a genuine operational issue or a measurement artifact.
Part 2: Build a Metric Hierarchy
Propose a structured set of metrics: one primary metric, supporting secondary metrics, and guardrails covering all three sides of the marketplace plus economics. For each important metric, state the direction of desired movement and the unit of analysis.
Part 3: Estimate the Causal Effect of the Intervention
Design a randomized experiment if one is feasible. Cover the randomization unit, what the control condition is, how you would log exposure, what population you would analyze, and what statistical approach you would use. Address interference, statistical power, novelty effects, and variation across segments. Then describe what you would do if randomization is off the table.
Part 4: Make the Launch Decision
The evaluation has concluded. Describe a decision framework for choosing between launching, iterating, collecting more data, or stopping. Specifically address: a statistically significant but negligibly small effect, a strong average effect that harms a particular segment, and a result that is inconclusive.
Hints
Hint 1
Before defining any metric, map the physical delivery funnel step by step — order placed, restaurant prep, food ready, driver pickup, transit, dropoff — and ask where heat loss is most likely to occur. A complaint label skips this entirely and may point you at the wrong stage.
Hint 2
Match the randomization unit to the unit at which the intervention is assigned, not to whatever gives you the most statistical power. A driver-level intervention randomized at the order level will produce severely biased estimates due to interference — the same driver carries both treatment and control orders.
Hint 3
When you reach the launch decision, evaluate four things independently: how much you trust the evidence, how large the effect actually is relative to cost, whether any guardrail was breached, and how easy it is to reverse the change. A p-value below 0.05 addresses only the first of these four.
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
Framing the Problem First
Before any analysis, ask two questions: what is the intervention and at what unit can it be assigned, and what is the minimum effect that would justify its cost and complexity? These answers drive every design choice downstream.
Part 1: Measuring the Problem
Constructing a cold-food incident definition
A workable starting definition: any delivered order that generates a support contact, refund, or rating response tagged with a temperature-related reason within 24 hours of dropoff. Restrict to items that are expected to arrive hot (exclude cold drinks, ice cream, salads).
State the limitations clearly:
- Under-reporting. Most customers who receive cold food never contact support. The true rate is higher than the label rate.
- Differential reporting. Contact rates vary by city, app version, refund policy, and how the support form prompts complaint categories. A spike in incidents may reflect a form redesign, not a real operational change.
- Label noise. Some customers use temperature complaints as a convenient path to a refund. Heavy concentration of complaints among a small group of repeat claimants is a signal of this.
Pair this label with a mechanistic proxy: elapsed time from food-ready at the restaurant to delivery at the customer's door, restricted to hot-food orders. This is not a perfect temperature measurement, but it reflects the physical process and is harder to game. If a direct signal is available — pilot sensor bags, post-delivery temperature surveys on a random sample — use it to calibrate both the label and the proxy against each other.
Estimating prevalence and finding concentrations
Walk the delivery funnel stage by stage: order placed → restaurant prep → food ready → driver arrival → pickup → any batched legs → dropoff. For each stage, compare the time distribution for incident orders against matched non-incident orders, controlling for market, hour, and cuisine category. Common problem sources include:
- Food sitting on the counter waiting for a driver who has not arrived yet (early prep or late dispatch)
- Batched or stacked orders where the second drop adds significant time
- Long delivery distances
- Slow handoffs at dense residential buildings
- High heat-loss items like fries versus items with low heat sensitivity
Compute incident rates broken down by city, time of day, weather, restaurant, driver, cuisine, distance decile, and batching status. For restaurant- and driver-level rates, apply empirical Bayes shrinkage so that a restaurant with three orders does not appear at the top of the ranking.
Separating real problems from artifacts
- Check whether complaint spikes align with app releases, support taxonomy changes, or refund policy updates.
- Check for a dose-response curve: incident rates should rise monotonically with food-ready-to-dropoff time if the problem is genuinely thermal. A reporting artifact typically does not show this pattern.
- Check whether a small fraction of customers accounts for a disproportionate share of complaints.
Part 2: Metric Hierarchy
| Layer | Metric | Direction | Analysis unit |
|---|---|---|---|
| Primary | Temperature-related incident rate per eligible delivered order | ↓ | Order, analyzed at randomization unit |
| Secondary | Food-ready-to-dropoff time for hot items; post-delivery "arrived hot" survey rate; temperature refund dollars per order; 28-day customer reorder rate | ↓ / ↑ | Order / customer |
| Customer guardrail | Delivery time vs. promise (p50 and p90); late-order rate | no regression | Order |
| Restaurant guardrail | Prep-time adherence; dispatch friction; restaurant churn | no regression | Restaurant |
| Driver guardrail | Earnings per active hour; acceptance rate; driver churn | no regression | Driver |
| Economics guardrail | Contribution margin per order; intervention cost; support cost per order | net positive | Order / market |
Connect these levels in a metric tree: retention and support cost at the top, incident rate one level down, operational drivers (wait time, travel time, batching) at the bottom. Drivers explain why the primary metric moved — they are not success criteria on their own. Pre-specify a non-inferiority margin for each guardrail before the experiment runs, for example "p90 delivery time may not increase by more than 90 seconds."
Part 3: Estimating the Causal Effect
Choosing the randomization unit
The right unit is wherever the intervention is assigned, not wherever you have the most statistical power.
| Intervention type | Example | Randomization unit | Key risk |
|---|---|---|---|
| Order-level | Dispatch timing nudge | Order or customer | Shared driver pool creates interference |
| Driver-level | Thermal bag, training | Driver | Driver carries both treatment and control orders if randomized below driver |
| Restaurant-level | Packaging upgrade, prep-timing integration | Restaurant, stratified by volume and cuisine | Few units, high variance |
| Market-level | Algorithm change | Switchback (market × time block) or geo-split | Very few units; needs long runs |
Experiment design
- Control: current experience with no modification.
- Exposure logging: record both assignment and actual exposure. Did the driver use the bag? Did the dispatch rule actually fire for this order?
- Analysis population: all eligible orders in the observation window, analyzed intent-to-treat. Treatment-on-the-treated via instrumental variables is a secondary analysis.
- Estimator: difference in incident rates. Apply CUPED using pre-experiment incident rates to reduce variance. Use cluster-robust standard errors at the randomization unit.
Interference: Order-level dispatch changes can redirect driver capacity away from control orders, making the control condition look artificially worse. This inflates the measured effect. Switchback or market-level designs eliminate this.
Power: Work backward from the minimum detectable effect. If baseline incident rate is 8% and the team needs to detect a 1.5 percentage-point reduction, calculate the required sample size accounting for the design effect from clustering. Aim for at least 80% power at a two-sided α of 0.05.
Novelty effects: Drivers may use new equipment diligently for the first two weeks and then revert. Run the experiment for at least three to four weeks and plot weekly treatment effects to check for decay.
Heterogeneous effects: Pre-register segments of interest — distance, batching status, cuisine heat sensitivity, market, weather — before looking at results. Estimate interaction terms or use a causal forest. Any pattern found outside the pre-registered list is a hypothesis for a follow-on study, not a confirmed finding.
If randomization is not available
Consider difference-in-differences or synthetic control across markets or restaurants with a staggered rollout. Regression discontinuity works if eligibility follows a sharp threshold (e.g., orders over a certain distance). Interrupted time series with a comparable control series is a weaker but usable fallback. In all cases, make the identifying assumptions testable: verify parallel pre-trends, run placebo outcomes (cold-drink complaints should not move), and test placebo launch dates.
Part 4: The Launch Decision
Evaluate four dimensions independently rather than collapsing the decision to a single p-value:
- Evidence quality: Was the randomization clean? Was there a sample-ratio mismatch? Do the label and the mechanistic proxy tell a consistent story?
- Effect size: Use the confidence interval, not the point estimate, and compare the lower bound against the minimum meaningful effect and the intervention cost.
- Risk: Did any guardrail breach its pre-specified non-inferiority margin?
- Reversibility: A feature flag rollback costs nothing. Purchasing thermal bags for every driver in every city does not.
Specific scenarios
Statistically significant but tiny effect. Compare the confidence interval against the cost and operational complexity of the intervention. A 0.2 percentage-point reduction in a low-cost software change may still be worth shipping. The same reduction for an expensive hardware rollout is probably not. Do not launch solely because the p-value is below 0.05.
Strong average effect but harm in one segment. Do not launch broadly. Investigate whether the harmed segment is avoidable — can the intervention be excluded for that context? If not, the net marketplace impact may still be negative. Document the finding and treat it as a constraint on the next design iteration.
Inconclusive result. Determine whether the experiment was underpowered, ran too short, or suffered from measurement noise before deciding whether to run a longer or larger follow-up. If the effect is likely below the minimum meaningful threshold even at the upper bound of the confidence interval, stop — you have effectively ruled out a large benefit, and continuing is not a good use of resources.