Build a Live Same-Day Delivery Dashboard for a Station Lead
System DesignModel answerLast updated
Design a dashboard for a delivery-station lead covering metric definitions, chart choices, layout, interactions, alerting, validation, and scalable aggregation that keeps tail behavior visible.
You are the analyst responsible for a live dashboard used by the lead of a last-mile delivery station. The lead makes same-day calls: pulling a dispatch wave forward, reassigning stops, adding a rescue courier, requesting extra flex capacity, or escalating a late inbound truck.
Design the dashboard end to end. Your answer should cover:
- Metrics and charts. Define precisely a set of operational metrics, for example on-time dispatch rate, backlog by hour, courier utilization, SLA risk by route, and defects per million orders. For each one, choose a visualization and justify it using the shape of the data (skew, bounded rates, rare events), seasonality, and how quickly the lead has to act.
- Layout. Describe the top-level KPIs, the time-series area, and the drill-down paths (route, zip code, courier).
- Interactions. Explain time selection, filters, cross-filtering, and how anomalies are annotated.
- Alerting. Propose thresholds and explain when to use absolute limits versus relative deviations from a baseline.
- Validation and honesty. Describe how you would test whether the dashboard actually helps (usability tasks, decision latency, false-alert rate) and how you would avoid misleading visuals, such as dual axes, truncated axes, and Simpson's paradox across zip codes.
- Scale. The station produces 50k+ events per day. Explain how you would aggregate data so the dashboard stays responsive without hiding the tails of the distributions (pre-aggregation, tiles, quantile sketches).
Be concrete: give formulas, example thresholds, and the trade-offs behind your choices.
Hints
Hint 1
Start from the decisions the lead makes and how many minutes they have; fast decisions need ranked, glanceable views, slower ones can use distribution views.
Hint 2
Always compare to a seasonal baseline (same weekday and hour), and pair any relative-change alert with an absolute floor so small denominators do not trigger noise.
Hint 3
50k events a day is tiny for storage; the real load is many viewers and percentile queries, so think about rollups by minute and hour, mergeable quantile sketches, and keeping raw events for drill-down only.
Model answer
Hard Try it yourself first — then compare your approach, complexity and edge cases.
Framing
Name the user and the decisions first. The lead acts within minutes: pull a wave forward, reassign stops, send a rescue courier, request flex capacity, escalate a late truck. The dashboard therefore optimizes time to a correct decision, not completeness. Refresh every 1-2 minutes, and keep package-level detail one click away.
Scale. 50k events/day is about 0.6 events/s on average, perhaps 10x at wave peaks. Storage is not the issue. The cost is concurrent viewers, drill-downs, and percentile queries, so pre-aggregation is about latency and consistency.
Metrics and visuals
| Metric | Definition | Visual | Why |
|---|---|---|---|
| On-time dispatch % | Routes leaving by planned time / routes planned | KPI card plus hourly line with a p5-p95 band from the same weekday over the last 4 weeks | Bounded rate with strong hour and weekday seasonality; the band says whether today is abnormal, not merely low |
| Backlog by hour | Packages received but not yet dispatched, split by stage (received, sorted, staged) | Stacked bars per hour plus a running-total line on the same axis | Counts are additive so stacking is honest; composition shows the bottleneck stage; the total shows whether the hole is growing |
| Courier utilization % | Active route time / scheduled time | Median line with p10-p90 band across couriers | Skewed, often bimodal (idle vs overloaded); a mean hides both tails |
| SLA risk by route | Probability of missing the promise window, from remaining stops, remaining time and current pace | Ranked bar or table sorted by expected late packages (risk x packages) | Fastest to act on; ranking by expected impact avoids chasing tiny high-risk routes |
| Route duration vs plan | Actual / planned duration | Box plot per route cluster with outliers | Right-skewed with heavy tails; better for next-day planning than live action |
| Geo backlog | Undelivered / planned packages per hex or zip | Map heatmap of the rate, count on hover | Reveals spatial clusters (closures, weather); normalizing avoids just showing density |
| Defects per million | (missing + damaged + mis-sorted + failed) / orders x 10^6 | Daily u-chart with control limits | Rare Poisson events, so hourly values are noise; control limits separate signal from chance |
Principle: fast decisions get glanceable, ranked views; slow decisions get distribution views. Seasonality is always handled with a same-weekday, same-hour baseline, never a flat target line.
Layout
- Top row: 5-6 KPI cards (on-time dispatch, current backlog, median utilization, routes at risk, projected on-time delivery, DPMO). Each shows value, delta vs plan and delta vs baseline. Status uses color plus an icon for colorblind accessibility.
- Middle: small multiples with a shared hour-of-day axis (backlog, dispatch %, utilization), vertically aligned instead of dual-axis.
- Bottom: drill-down tabs for route, zip, courier. Ranked risk table on the left, map on the right, cross-filtered. Drill path: KPI, route, courier, package scan history.
Interactions
- A time brush filters all panels; default is today so far plus projection to cutoff.
- Slicers: shift/wave, route cluster, carrier partner, service type. Active filters stay visibly pinned so a filtered view is never mistaken for the whole station.
- Annotations: automatic anomaly markers plus manual notes ("inbound truck 40 min late", "rain"). The notes also become labeled data for tuning alerts.
- Cross-filtering and a "compare to" toggle (plan, last week, 4-week median).
Alerting
- Absolute thresholds for hard constraints where baseline is irrelevant: on-time dispatch below 95% at wave cutoff, any route with risk above 0.7 and more than 20 packages, any safety or damage event.
- Relative thresholds where the baseline is seasonal: backlog at 10am Monday legitimately differs from Thursday, so alert on a z-score above 3 or more than 25% over the expected same-hour value.
- Combine them to kill small-denominator noise: 2 late packages to 4 is +100% but trivial. Require, say, more than 25% over baseline and more than 150 extra packages. For rates use Wilson intervals or control limits rather than raw percent change.
- Noise control: require two consecutive intervals, add hysteresis (clear threshold below fire threshold), deduplicate per route, use severity tiers routed to the right owner.
Validation
- Task-based usability tests with 5-8 leads: "Which three routes need a rescue courier?" and "Is the backlog a sort or staging problem?" Measure accuracy and time-to-answer against the current tool.
- Decision latency: time from anomaly onset to logged action.
- Alert quality: precision (alerts that were real or acted on; target 70%+), recall against postmortem incidents, and false alerts per lead per shift.
- Staggered rollout across stations, comparing on-time delivery and rescue cost with and without the dashboard.
- Panel telemetry: remove panels nobody opens.
Misleading-visual traps
- Dual axes: avoid; use aligned small multiples or index both series to a baseline.
- Truncated axes: bars start at zero; lines may zoom but show the baseline band for context.
- Simpson's paradox: an overall on-time rate can improve while every zip worsens if volume shifts toward easy zips. Show the mix next to the rate and offer a mix-adjusted (standardized) view; drill down before drawing conclusions.
- Averages over skewed data: show percentiles. Also avoid red/green-only encoding and unlabeled filters.
Aggregation at scale
- Stream events into a store and maintain 1-minute and 1-hour rollups by dimension (route, zip/hex, wave, stage): counts, sums, and a quantile sketch (t-digest or DDSketch) per cell.
- Sketches are mergeable, so hourly or station-level p95/p99 come from combining minute sketches without losing the tail, whereas averaging percentiles is wrong. Relative-error guarantees (about 1%) are fine for a dashboard.
- Pre-compute map tiles (H3 hexes at a few resolutions) so zooming is a lookup.
- Keep raw events for drill-down only, queried with tight filters. Cache the "today" view and invalidate on each rollup tick.
- Late and duplicate events: use event-time windows with a short watermark, idempotent keys, and re-emit corrected rollups.
- Preserve tails by storing max, counts above SLA thresholds, and top-N worst routes explicitly alongside the sketches.
Common mistakes
- Packing in every metric instead of tying each to a decision.
- Alerting on raw percent change with tiny denominators.
- Averaging pre-computed percentiles across groups.
- Using a flat target line against seasonal data.
- Not measuring whether alerts lead to action.