Design a resilient dasher payment system
Company: DoorDash
Role: Software Engineer
Category: System Design
Difficulty: hard
Interview Round: Technical Screen
Design an end-to-end payment system for delivery drivers (Dashers) that computes payouts from order lifecycle events. The event stream contains ACCEPT(orderId, dasherId, timestamp) and FULFILL(orderId, dasherId, timestamp) records. Requirements: assume the inputs to the calculation job are valid for the happy path; proactively discuss how you would detect and remediate data loss or corruption, such as when a FULFILL arrives without a prior ACCEPT, an ACCEPT has no subsequent FULFILL, duplicate events, or out-of-order delivery. Describe data models, storage choices, and indexing to support high write throughput and efficient payout queries per dasher and pay period. Explain idempotency, deduplication, and exactly-once versus at-least-once semantics for event ingestion. Outline batch versus streaming computation of payouts, backfills, and reconciliation. Define APIs for event ingestion and for querying a dasher’s payout for a given local pay period, and how you would handle timezone and DST. Discuss monitoring, alerting, and correctness checks, and be explicit about trade-offs and consistency guarantees.
Quick Answer: This question evaluates system design and distributed-systems competencies including event-driven architecture, ingestion semantics (idempotency and delivery guarantees), high-throughput data modeling, streaming versus batch payout computation, data quality and remediation workflows, API and timezone handling, and operational monitoring.