Design Driver Earnings System

Medium45 min
1 / 30
understanding8 min read

Problem Statement: Driver Earnings & Payout Platform

Problem Statement: Driver Earnings & Payout Platform — driver earnings interview depth

Problem Statement: Driver Earnings & Payout Platform

A driver earnings platform turns completed trips into spendable balance and bank deposits without double-paying or losing cents to race conditions. Interviewers at Uber/Lyft/Instacart probe ledger invariants, payout idempotency, and regulatory audit in one arc—not as isolated buzzwords.

LensDetail
Primary actorDriver expects real-time balance + weekly/instant payout
Money truthAppend-only ledger; balances are derived, never edited in place
Hot pathtrip.completed → earning.accrued → wallet.updated push
Failure postureFail closed on duplicate payout keys; never negative cash without reserve

Section focus (sec-001): drivers trust cents-level accuracy more than sub-10ms vanity latency. Engineers tracing Problem Statement: Driver Earnings & Payout Platform should follow driver DRV-88421 completing trip T-99102: platform fee $4.20, driver earning $18.40, tip $3.00 posts as separate accrual with idempotency_key=T-99102:tip. On-call watches ledger_lag_ms, payout_stuck_count, and balance_drift_cents. When ACH partner lags, surface last_good_balance in app and queue payout retry with exponential backoff capped at 6h.

Core mechanism for this slice: payout rail orchestrates accrual vs disbursement boundaries. At 425k payout requests/day peak, shard workers by driver_id mod 512 to avoid wallet hot keys.

javaOne Dark Pro
1public record LedgerEntry(String entryId, String driverId, long amountCents, String idempotencyKey, Instant postedAt) {}
pythonOne Dark Pro
1def compute_available_balance(posted: int, pending_payout: int, holds: int) -> int:
2 return posted - pending_payout - holds
typescriptOne Dark Pro
1export interface DriverWallet { driverId: string; availableCents: number; pendingPayoutCents: number; version: number; }

Deep dive (sec-001)

Walk the interviewer through one failure: duplicate trip.completed event. Without idempotency, wallet credits —support refunds cost more than infra. Use outbox + consumer with unique constraint on (driver_id, idempotency_key). For Problem Statement: Driver Earnings & Payout Platform, cite p99 balance read 38ms via read model fed by ledger projector, not synchronous double-write to Postgres + Redis.

Why interviewers care

Driver Earnings System interviews reward crisp scope, explicit trade-offs, and failure stories—not generic microservice diagrams.

Interview checkpoint

Name one failure story for Problem Statement: Driver Earnings & Payout Platform that proves you understand real outages, not happy-path diagrams.

Key Highlights

  • Ledger-first truth for Problem Statement: Driver Earnings & Payout Platform (sec-001)
  • Idempotency on trip.completed and payout.initiated
  • Derived wallet balance via projector
  • understanding phase checkpoint
pro tip
sec-001: Post tips as separate accruals with their own idempotency keys.
interviewer loves
sec-001: Mention reconciliation batches when discussing payout partners.
common mistake
sec-001: Storing mutable balance columns without append-only ledger.
trade off
sec-001: Instant pay fees vs driver satisfaction—quote both in API.

Section Rescue Kit

Buzzwords to use:

Double-entry ledgerPayout idempotency key

Safe statements:

  • "Before naming cloud SKUs for Problem Statement: Driver Earnings & Payout Platform, I'll quantify trips/day and payout fan-out."
  • "Balances are derived from ledger—never 'fix' wallets with ad hoc SQL."
Design Driver Earnings System - System Design | WinJob | WinJob