Katkat

Design an API for pay computation with retries

DoorDashSoftware Engineer · Online Assessment

Last updated

Assesses the candidate's ability to design robust HTTP APIs covering endpoint modeling, request/response schemas, datetime formats, idempotency strategies, retry semantics, validation/error codes, and observability for pay-computation services.

You’ve implemented logic that computes a dasher’s pay from order event logs (events include timestamps and state transitions).

Design an HTTP API to expose this as a service. Cover:

  • Endpoints (e.g., compute pay for a dasher over a time window; submit events; query results)
  • Request/response schema (including datetime formats)
  • Idempotency strategy (to safely handle client retries)
  • Failure handling and retry semantics (client vs server retries, timeouts, backoff)
  • Validation and error codes
  • Observability (logging/metrics/tracing)

Assume this API will be called by other internal services and must be robust to duplicate requests and partial failures.