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.

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.

EasyTechnical
33 practiced

A mobile detail screen always needs an object but only sometimes needs its large related collection, such as comments. How would you design a single endpoint so the client can get the object with or without the collection? Show a sample request and response and explain the trade-offs.

EasyTechnical
40 practiced

The responses of a JSON API consumed by mobile devices are too heavy for cellular connections. Name three changes you would make to cut the bytes on the wire, and for each one explain how you would implement it on the server and how the client benefits.

HardSystem Design
47 practiced

A social app's home feed mixes posts, ads and friend suggestions, and the mobile client currently makes many calls to render it. Design server-side strategies that minimize the number of calls the client needs. Consider personalization, A/B tests and privacy filters, and show the API shape and caching approach.

EasyTechnical
44 practiced

Your mobile app's article list downloads full article objects but each row only shows a title, an author name and a thumbnail. How would you let a client ask for just what a screen needs? Show what the request and response could look like for REST and for GraphQL, and say what the server has to be careful about (computed fields, default fields, caching).

Unlock Full Question Bank

Get access to all 12 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.