Home Depot API Design Interview: Surface & Contracts
Question Description
You’re asked to design a complete HTTP API surface, request/response contracts, and documentation for a concise product goal (assume JSON over HTTP unless stated otherwise).
Start by enumerating a focused set of endpoints (method + path) that cover the product’s CRUD and common collection operations. For each endpoint you’ll then specify required headers, path/query parameters, and a high‑level JSON schema for the request body, plus validation rules (lengths, allowed enums, mutually exclusive fields, idempotency notes).
Next define the response contract for success and failure: HTTP status codes and rationale, the JSON shape returned (including pagination metadata when applicable), and a single, consistent error format (code, message, details). Call out delivery semantics such as synchronous vs asynchronous responses, and any eventual consistency that affects what clients should expect.
Finally produce a concise documentation outline (overview, auth, global headers/conventions, endpoints with examples, errors, versioning, examples/SDKs, changelog) and a short client pseudocode snippet that demonstrates authentication plus a common workflow (create → read/list → update → delete) with basic error handling.
This task evaluates your API ergonomics, consistency, attention to validation and versioning, and ability to explain developer-facing contracts clearly. Focus on clarity, predictable behavior, and minimal, non‑overlapping endpoints.
Common Follow-up Questions
- •How would you add authentication and fine‑grained authorization (scopes or roles) to the API? Describe token formats and revocation.
- •Design a rate‑limiting and throttling strategy: what headers, status codes, and client backoff guidance would you expose?
- •If creating resources can take several seconds, how would you model asynchronous creation (202 Accepted, status polling, webhooks)?
- •How would you version the API to allow breaking changes while maintaining backward compatibility? Show example URL and header approaches.
- •Describe how you’d support bulk operations and their error semantics (partial success, transactional rollback, idempotency keys).
Related Questions
Explore More Questions
Practice This Question with AI
Get real-time hints, detailed requirements, and insightful analysis of the question.