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.

MediumTechnical
37 practiced

A dashboard must show nested data drawn from several services (users, posts, comments) with flexible fields per widget. Would you adopt GraphQL or add composite REST endpoints? Weigh the frontend, backend, caching and authorization consequences of each, and say what you would do to keep each option healthy under load.

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.

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?

HardSystem Design
46 practiced

Three internal microservices each use a different auth scheme, pagination style and error format, and your web app has to render screens from all of them. Design the Backend-for-Frontend that sits in front. What belongs in it, what should stay out of it, and when would you rather normalize in the frontend instead?

Unlock Full Question Bank

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