Build a Resilient Bootstrap API with Partial Upstream Results
DoorDashSoftware Engineer · OnsiteLast updated
Combine Consumer, Payment, and Address APIs with correct identifier dependencies, partial success, bounded timeouts, and complete response fields.
Implement the design of a resilient bootstrap API that accepts user_id and combines information from three existing upstream services. Boilerplate and mock services are available.
Requirements and Constraints
- Consumer accepts
user_idand returns user information includingconsumer_idand roles. - Payment accepts
consumer_idand returns the default card and available gift-card credit. - Address accepts
consumer_idand returns the formatted address, first name, and last name. user_idandconsumer_idare different identifiers.- Consumer failure may make the bootstrap request fail with HTTP 500.
- Payment or Address failure must preserve the remaining available information.
- The result must include the required address name fields when Address succeeds.
Explain the call sequence, response structure, HTTP and timeout handling, and the tests needed to demonstrate the required behavior. This is a service-integration exercise; no real upstream endpoint or response schema beyond the listed fields is supplied.
Clarifying Questions
- Which non-success status codes can each upstream return, and which ones mean the upstream data is absent rather than temporarily unavailable?
- How should the bootstrap response represent an unavailable optional section: omission, null, or a structured error?
- What total request deadline and per-upstream timeouts are acceptable?
- Are the upstream operations safe to retry, and would retrying fit within the caller's remaining deadline?
Hints
Hint 1
Draw the identifier dependency: The optional services do not take the bootstrap API's original identifier. Establish which successful result supplies the identifier they require before choosing the parallel calls.
Follow-up questions
- What should the response contain when Consumer and Payment succeed but Address fails?
- What should happen when both optional services time out after Consumer succeeds?
- Why might catching exceptions alone fail to detect an upstream HTTP 500 response?
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.