Expected Rider Wait When Food Readiness Is Uncertain

Last updated: November 29, 2026

Quick Overview

Food for an order becomes ready at a time uniformly distributed between 0 and 20 minutes after acceptance, and the rider is scheduled to reach the restaurant at minute 12. Find the expected rider wait and expected time food sits waiting, then the arrival time that minimizes a weighted cost when rider minutes cost three times food minutes.

Swiggy
Statistics & Math
Data Scientist
Swiggy
November 29, 2026
Data Scientist
Phone Screen
Statistics & Math
Easy

0

0

0 solved


Food for an order becomes ready at a time uniformly distributed between 0 and 20 minutes after acceptance, and the rider is scheduled to reach the restaurant at minute 12. Find the expected rider wait and expected time food sits waiting, then the arrival time that minimizes a weighted cost when rider minutes cost three times food minutes.

Swiggy times rider arrival at the restaurant against predicted preparation time: too early wastes fleet capacity, too late lets food go cold. The phone screen checks expectation of a truncated variable and whether you recognize the newsvendor-style quantile answer.

What the Interviewer Expects
  • Writes rider wait as max(R - t, 0) and food wait as max(t - R, 0)
  • Integrates correctly over the uniform density
  • Derives the optimal arrival as a quantile of the readiness distribution
  • Gives the numeric answers 1.6, 3.6 and 15 minutes
  • Interprets the result in operational terms
Key Topics to Cover
expectation
uniform distribution
newsvendor quantile
asymmetric loss
How to Approach This
  1. Define your hypotheses (H0 and H1) clearly before performing any test.
  2. Calculate required sample size BEFORE running an experiment, using power analysis.
  3. Remember the Central Limit Theorem: sample means become approximately normal with large n.
  4. Watch for Simpson's paradox. Always segment data by key dimensions.
  5. Distinguish between statistical significance and practical significance.
Possible Follow-up Questions
  • How does the answer change if preparation time is right-skewed, say log-normal?
  • What if the cost of cold food grows with the square of the wait?
  • How would you estimate the readiness distribution from data where you only see when the rider left?
  • How should the arrival target differ during a peak when riders are scarce?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Browse Statistics Questions
Sample Answer
Clarify

Let R∼U(0,20)R \sim U(0, 20) be readiness time in minutes and tt the rider arrival. Rider wait W=max⁡(R−t,0)W = \max(R - t, 0), food wait F=max⁡(t−R,0)F = \max(t - R, 0). Cost weights: a=3a = 3 per rider minute, b=1b = 1 per food ...

Approach

Compute both expectations by integrating against the density 1/201/20, then minimize C(t)=aE[W]+bE[F]C(t) = a E[W] + b E[F] by differentiating with respect to tt....


Submit Your Answer
Markdown supported

Related Questions