Diagnosing and Reducing Temperature Complaints in Food Delivery
Statistics & ExperimentsModel answerLast updated
Identify why meals arrive at suboptimal temperatures, design metrics to quantify the issue, and structure a controlled test to validate a solution.
You work as a data scientist on a food delivery platform's operations team. User feedback indicates that many meals don't maintain proper temperature during transit.
Your task is to:
-
Investigate the root causes: How would you determine why meals lose temperature? What breakdown would you use to isolate the problem areas?
-
Define measurement: The platform doesn't have temperature sensors. How would you quantify this issue using available data?
-
Design an intervention test: Propose a solution (such as improved carrier equipment, adjusted dispatch timing, or modified batching rules) and structure a rigorous experiment to evaluate it. Specify your hypothesis, how you'll assign units to test groups, which metrics you'll track, and how you'll calculate the required test duration.
-
Account for system interactions: The platform is a marketplace where drivers, restaurants, and customers interact. How does this affect your experimental design choices?
Explain your reasoning at each step, including any assumptions you're making and potential complications you'd need to address.
Hints
Hint 1
Break the delivery lifecycle into sequential stages from order placement through final handoff, measuring duration at each step
Hint 2
Since direct temperature measurement isn't available, identify observable behaviors that correlate with the underlying quality issue
Hint 3
Marketplace dynamics mean that changing how one group of orders is handled can affect other orders competing for the same resources—consider this when choosing your randomization approach
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
Model Answer: Temperature Quality Investigation and Test Design
Understanding the Assessment
This question evaluates your ability to translate qualitative feedback into actionable analysis, design meaningful metrics without direct measurement, decompose complex operational systems, and structure experiments that account for real-world interference patterns.
Part 1: Quantifying the Problem
Since we lack temperature sensors, we need observable proxies:
Lagging indicators (outcome):
- Temperature complaint rate: percentage of completed orders where customers report temperature issues via support contacts, ratings, or refund requests
- Quality-related refund volume: dollar amount attributed to temperature complaints
- Low ratings with temperature signals: 1-2 star ratings containing keywords like "cold," "lukewarm," or "soggy" (requires text classification)
Leading indicators (mechanism):
- Total exposure time: interval between when the restaurant marks food ready and actual delivery completion
- This is measurable for every order and provides early signal before complaints arise
Validation step: Plot complaint rate against exposure time in 5-minute buckets. You should observe a monotonic relationship, possibly with an inflection point (e.g., complaints accelerate beyond 30 minutes). This establishes that exposure time is a valid proxy worth optimizing.
Part 2: Diagnosing Root Causes
Decompose each order into timestamped phases:
- Restaurant preparation: Order received → Food marked ready
- Wait for pickup: Food ready → Driver arrives at restaurant
- In-transit batching: Pickup → Delivery (potentially includes other stops)
- Final handoff: Arrival at address → Customer receives food
Data collection (order-level):
- All lifecycle timestamps with second-level precision
- Driver GPS trajectory and speed
- Whether order was batched with others, and sequence position
- Restaurant type, cuisine category, specific items ordered
- Travel distance, driver vehicle type, driver experience level
- Delivery location attributes (residential, high-rise, commercial campus)
- Time of day, day of week, local weather conditions
- Customer complaint records and rating data
- Subsequent reorder behavior within 30 days
Analytical approach:
Compare orders with temperature complaints against those without complaints across all these dimensions. Use regression analysis (logistic for complaints, linear for exposure time) with zone and time-of-day fixed effects to isolate the strongest predictors.
Likely hypotheses to emerge:
- Restaurants consistently overestimate prep time, causing drivers to arrive too early and wait
- Second deliveries in batched orders experience 10-15 additional minutes of exposure
- Certain cuisines (fried foods, noodle dishes) are more temperature-sensitive
- High-rise buildings add significant handoff delays
- Drivers lacking insulated carriers or not using them properly
- Cold weather accelerates heat loss during transit
Calculate each factor's contribution to excess exposure time. For example: "Batching accounts for 35% of exposure time above our 25-minute threshold."
Important caveat: All of this is correlational. Complaints are underreported and may correlate with customer segment or order value. Restaurant "ready" timestamps are self-reported and noisy. These findings inform where to test interventions, but causality must be established experimentally.
Part 3: Metrics Framework
| Category | Metric | Purpose |
|---|---|---|
| Primary success | Temperature complaint rate (per 1,000 orders) | Direct outcome measure |
| Mechanism | Mean and 90th percentile exposure time | Leading indicator we can optimize |
| Customer experience guardrails | Promised delivery time accuracy; overall rating; late delivery rate | Ensure we don't degrade other quality dimensions |
| Marketplace health | Driver deliveries per active hour; driver earnings per hour; order acceptance rate | Ensure driver economics remain viable |
| Business guardrails | Cost per delivery; refund costs | Track operational efficiency |
| Long-term | 30-day reorder rate | Measure sustained behavior change |
Part 4: Experiment Design
Suppose analysis reveals that pickup delays and batching drive most excessive exposure. The proposed intervention: temperature-aware dispatch that improves prep-time forecasting and restricts batching when estimated detour exceeds a threshold for temperature-sensitive items.
Hypothesis:
- Null: The modified dispatch logic has no effect on temperature complaint rate
- Alternative: It reduces complaint rate by at least 15% relative to baseline, without increasing median delivery time beyond 1 minute or reducing driver efficiency by more than 3%
Critical design decision: Randomization unit
Randomizing individual orders or customers would be incorrect. Treated and control orders share the same driver pool. If treatment restricts batching, it consumes more driver capacity, slowing down control orders through resource competition. This spillover violates the stable unit treatment value assumption (SUTVA) and contaminates your comparison.
Better approaches:
Option A: Time-based switchback (preferred)
- Divide the service area into geographic zones
- Within each zone, alternate between control and treatment in 75-90 minute blocks
- Randomize the starting condition and balance across hours and days
- Analyze outcomes aggregated at the zone-time-block level
Option B: Geographic cluster randomization
- Create matched pairs of similar zones based on historical volume, complaint rates, and driver supply
- Randomly assign one zone in each pair to treatment
- Requires more zones but simpler to implement
For equipment interventions (like providing insulated carriers), randomize at the driver level since equipment doesn't affect dispatch logic and creates minimal interference. Measure both intent-to-treat (all assigned drivers) and effect-of-using (accounting for compliance via photos or self-reports).
Staged rollout:
- Pilot in 3 zones for 1 week to verify technical implementation and check for unexpected guardrail violations
- Expand to 30-40 zones for the powered experiment
- If successful, full rollout while maintaining a 5% holdout to measure long-term reorder effects
Analysis approach:
- Aggregate complaints and orders at the cluster level (zone-timeblock or zone)
- Model as a ratio using the delta method or cluster-robust standard errors
- Apply CUPED (Controlled-experiment Using Pre-Experiment Data) variance reduction by including pre-period complaint rates as a covariate
- Examine heterogeneous treatment effects by cuisine type, distance, and weather—this informs targeted rollouts
Part 5: Sample Size Calculation
Assumptions:
- Baseline complaint rate: 1.8%
- Target reduction: 15% relative (0.27 percentage points absolute)
- Significance level: α = 0.05 (two-tailed)
- Statistical power: 80%
For independent orders:
n = 2 × (z₀.₉₇₅ + z₀.₈₀)² × p(1-p) / δ² n = 2 × (1.96 + 0.84)² × 0.018(0.982) / (0.0027)² n ≈ 95,000 orders per arm
Adjustment for clustering:
Orders within the same zone-timeblock are correlated. Design effect = 1 + (m - 1) × ICC, where m is average cluster size and ICC is intracluster correlation.
With m ≈ 350 orders per cluster and ICC ≈ 0.015: Design effect = 1 + 349 × 0.015 ≈ 6.2
Adjusted requirement: 95,000 × 6.2 ≈ 590,000 orders per arm
Runtime estimation: If each zone produces 8,000 orders per day and we have 40 zones (20 per arm):
- Orders per arm per day: 20 × 8,000 = 160,000
- Days needed: 590,000 / 160,000 ≈ 4 days
With switchback design, each zone contributes to both arms, so with 40 zones:
- Total daily orders: 40 × 8,000 = 320,000 (split roughly evenly)
- Days needed: (590,000 × 2) / 320,000 ≈ 4 days
Add 1-2 days as buffer for weekend/weekday balance. Total runtime: approximately 1 week.
Common Mistakes to Avoid
- Ignoring interference: Treating this as a simple A/B test without accounting for shared driver supply leads to biased estimates
- Using complaints alone: Complaints are sparse and biased; always track the mechanism (exposure time) alongside outcomes
- Insufficient granularity: Analyzing at order level instead of cluster level when using geographic or time-based randomization
- Missing guardrails: Focusing solely on temperature while inadvertently degrading delivery speed or driver earnings
- Premature conclusions: Treating diagnostic correlations as causal without experimental validation