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
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.

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.

MediumSystem Design
47 practiced

Design an endpoint that lets a client receive only the changes since its last sync. Specify the request parameters, the ordering and idempotency guarantees you give, and the response format for creates, updates and deletes. What happens when the client's marker is missing or too old?

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.

MediumTechnical
40 practiced

Your team is deciding between GraphQL and plain REST for a new API that mobile clients will call. What scenarios would push you toward each, and what would you ask before deciding?

Unlock Full Question Bank

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