Design an API for pay computation with retries

Read the full interview experience this question came from →

Quick Overview

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.

Design an API for pay computation with retries

Company: DoorDash

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: medium

Interview Round: Online Assessment

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.

Overview: 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.

Read the full DoorDash Software Engineer interview experience this question came from

Community answers

Answer by gabrielalveskuabara

Requirements: Payout amount for orders Calculate payout for each event (Define rules) Only finished events should be considered Parameters: driver_id time_window Response: HTTP response with float amount API request for dependecies: Has driver_id and time_windows to query all orders started and finished in this window Idempotency: After calculating payout, mark orders as paid Failure handling: Set retries, timeouts and backoff in case request fails
|Home/Software Engineering Fundamentals/DoorDash
DoorDash logo
DoorDash
Jan 14, 2026
mediumSoftware EngineerOnline AssessmentSoftware Engineering Fundamentals
13
0

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.

Loading comments...