Design Driver Allocation System

Hard45 min
1 / 30
understanding9 min read

Problem Statement: Proactive Driver Positioning

Problem Statement: Proactive Driver Positioning — driver allocation interview depth

Problem Statement: Proactive Driver Positioning

Phase understanding — Ride-sharing marketplaces lose money two ways at once: riders wait (or churn) where there are too few drivers, and drivers burn empty miles cruising where there is no demand. Allocation attacks this proactively — it forecasts demand a few minutes out per geographic cell and nudges idle drivers toward the gaps before requests arrive. That is a distinct problem from dispatch matching, which reactively assigns a specific driver to a specific trip in sub-second time. The interview signal is whether you keep the two separate: allocation shapes supply posture over a 5–15 minute horizon; dispatch optimizes a single trip assignment right now. Conflate them and you get a design that either cannot plan ahead or cannot react fast enough.

LensDetail
Signalingest trips, cancellations, events, weather overlays per H3 cell
Forecast5–15 minute horizon demand intensity + confidence band
Supplyonline drivers, utilization, recent acceptance, heading vector
Actionreposition nudge with TTL; hard cap nudges/hour to prevent churn

Track supply_gap_index_p95, forecast_age_sec, nudge_accept_rate, empty_mile_km_saved, and rider_wait_p90_delta. Page when forecast_age_sec > 180 in a hot cell or when nudge_accept_rate collapses after a model deploy.

Code anchors

javaOne Dark Pro
1public record CellForecast(String h3, double demandIndex, double confidence, Instant asOf) {}
pythonOne Dark Pro
1def supply_gap(forecast: float, supply: float) -> float:
2 return max(0.0, forecast - supply)
typescriptOne Dark Pro
1export interface RepositionNudge { driverId: string; targetH3: string; ttlSec: number; allocationRunId: string; }

Why interviewers care

Allocation is a forecasting-and-incentives problem wearing a distributed-systems costume, and that is what makes it a strong interview: it forces you to reason about stale predictions, driver behavior (nudges are advisory — a driver can ignore one), and the blast radius of a bad model deploy, not just boxes and arrows. Strong candidates name the failure modes (a forecast that lags a sudden surge, a nudge storm that over-corrects a cell) and show how the system degrades safely.

Interview checkpoint

A concrete failure to keep ready: a concert lets out and demand in one H3 cell spikes 5x in two minutes, but the forecast still reflects the pre-surge baseline. Allocation under-nudges, riders wait, surge climbs, and drivers pile in late — overshooting the cell. The fix is a fast-reacting nowcast that blends the model with the last 60–90s of live requests, plus a per-cell nudge cap so the correction does not whipsaw.

Key Highlights

  • Anchor demand–supply imbalance for allocation
  • Separate reposition nudges from dispatch trip locks
  • Version snapshots with allocation_run_id
  • Guard driver trust with nudge rate limits
pro tip
Driver allocation sec-01: pro-tip — tie decisions to allocation_run_id and allocation runs.
interviewer loves
Driver allocation sec-01: interviewer-loves — tie decisions to allocation_run_id and allocation runs.
common mistake
Driver allocation sec-01: common-mistake — tie decisions to allocation_run_id and allocation runs.
trade off
Driver allocation sec-01: trade-off — tie decisions to allocation_run_id and allocation runs.

Section Rescue Kit

Buzzwords to use:

Demand heatmap generationreposition scoring

Safe statements:

  • "For Problem Statement: Fleet Driver Allocation, I'll pin allocation_run_id before discussing solver choice."
  • "Let me quantify cells and vehicles before picking heuristic vs MILP."
Design Driver Allocation System - System Design | WinJob | WinJob