Backend-for-Frontend and Client-Specific API Design Questions

Shaping API responses to the needs of specific client types: the Backend-for-Frontend (BFF) pattern, one BFF per client versus a shared gateway, client-side composition or a generic API, what belongs in a BFF (including normalizing inconsistent downstream pagination and error formats for one client), and aggregating several backend calls into one client-shaped response. Covers payload shaping (sparse fieldsets and field selection against relational and document stores, partial responses, optional expansion of related collections, delta responses with deletions, compact serialization including binary wire formats), round-trip reduction and composite views for feeds and dashboards, adapting to mobile versus web bandwidth, battery and device constraints (device-appropriate image variants, prefetching and refresh frequency tuned to connection quality), and choosing GraphQL versus REST to fix over- and under-fetching, including incremental migration from REST to GraphQL. Authentication, general REST resource design, versioning, rate limiting, offline sync and real-time transport are covered elsewhere.

MediumTechnical
48 practiced

Your analytics dashboard renders a dozen widgets, and each one currently calls its own backend endpoint, so users stare at spinners for seconds even though each call is fast. What would you change on the API side to cut perceived latency, and how would those changes affect what the frontend can render first?

MediumTechnical
45 practiced

Your large REST-based product wants to adopt GraphQL without a rewrite. Propose a migration path that keeps existing clients working while screens move over one at a time, and say how you would decide when the old endpoints can be retired.

HardTechnical
48 practiced

Clients can ask your resource endpoints for only some of the fields. How would you implement that field selection on the server, against a relational database and against a document store, so it actually reduces backend work and not only response size?

EasyTechnical
46 practiced

What are over-fetching and under-fetching in client-server APIs, and how do REST and GraphQL each deal with them? Describe what a frontend or mobile client feels from each approach.

HardSystem Design
43 practiced

You need one API strategy that serves mobile clients on poor connectivity and web clients that need rich interactivity. Would you serve both from the same API, a shared gateway, or separate client-specific backends? How would the protocol, payload shape and caching differ per client class?

Unlock Full Question Bank

Get access to all 18 Backend-for-Frontend and Client-Specific API Design interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.