DoorDash VO Interview Question: Get User Bootstrap Response (API Aggregation and JSON Assembly)

18 Views
No Comments

GET /api/bootstrap

Request input: User Id

Response: address, consumer, and payment data

{
  "consumerId": "1bef988e-e544-11ed-b5ea-0242ac120002",
  "roles": [],
  "defaultCard": {
    "lastFourDigits": "1234",
    "expirationYear": "2024",
    "expirationMonth": "01",
    "fingerPrint": "f3cd76f4-e544-11ed-b5ea-0242ac120002",
    "createdAt": "2022-07-15"
  },
  "availableGiftCardCredits": "0.0",
  "address": "Foo Bar, 303 2nd Street, San Francisco, CA 94105"
}

Additional APIs referenced in the prompt:

  • GET /api/consumers/{userId}
  • GET /api/payment_methods/
  • GET /api/address/

This problem is an API aggregation exercise: given a user id, combine consumer, payment method, and address data into one bootstrap response. The key is to map fields correctly across multiple response objects and preserve the expected JSON structure, including values such as consumerId, defaultCard, giftCards, and address. A clean object-oriented design that models each service response separately and assembles them at the top level is the most natural solution.

END
 0