Backend-for-Frontend and Client-Specific API Design Questions
Shaping APIs to the needs of specific consumers: Backend-for-Frontend (BFF) pattern, aggregating/tailoring payloads per client, mobile vs. web bandwidth and battery constraints, and reducing round trips for constrained clients. Covers response shaping, partial responses, and balancing a generic API against client-optimized endpoints.
Design a flow for uploading large user files (photos/videos) from a browser to AWS S3 using presigned URLs that supports resumable/multipart uploads, shows progress to users, ensures users cannot overwrite each other's files, and triggers server-side virus scanning before the file is considered available. Describe the endpoints, S3 configuration, presign lifetime strategy, frontend chunk coordination, and how to finalize and verify successful uploads.
You must implement a saga-based orchestration for creating an order that requires calling a payment gateway and reserving inventory across different services. Describe the API endpoints, message/event contracts, compensation endpoints, idempotency tokens, how you would store saga state, and how the frontend should present intermediate and final states (pending, compensated, failed). Discuss trade-offs between orchestration vs choreography.
Design a synchronization protocol for an offline-first collaborative notes app where users can edit the same notes offline and sync later. Compare conflict-resolution approaches (CRDTs, Operational Transform, Last-Writer-Wins), design server endpoints for exchanging operation logs and checkpoints, recommend storage and token formats for incremental sync, and explain how to handle large binary attachments alongside text changes securely and efficiently.
Write JavaScript code (browser environment) that performs a GET request to /api/resource using fetch, implements up to 3 retries with exponential backoff (e.g., 500ms, 1000ms, 2000ms), does not retry on 4xx responses, and supports cancellation via AbortController. Show the retry logic and how errors are surfaced to the caller.
Design a resilient, high-throughput public API platform expected to handle 50,000 requests per second at peak. Include the role of an API gateway, edge caching/CDN, authentication at scale, routing to microservices, caching strategies, databases, observability and tracing, circuit breakers, and autoscaling. Explain choices for authentication enforcement, edge caching for public endpoints, and failover strategies for downstream dependencies.
Unlock Full Question Bank
Get access to all 30 Backend-for-Frontend and Client-Specific API Design interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.