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.
Compare approaches for implementing the same API integration across React Native and Flutter. Discuss how to maximize shared code (business logic, models), when to write native modules or platform channels, error handling cross-platform, and strategies for testing and deploying shared networking logic.
Design an API for infinite-scroll on mobile using cursor-based pagination. Specify request parameters, sample JSON response including items, next_cursor and has_more, handling of expired/invalid cursors, maximum page size, and how to mitigate duplicates or missing items if the underlying dataset changes while the user scrolls.
Describe common API rate-limiting algorithms mobile clients will encounter: fixed-window, sliding-window, and token-bucket (leaky bucket). For each algorithm, explain how a mobile client should adapt (backoff strategies) and what server-side headers (e.g., X-RateLimit-Remaining, Retry-After) are helpful to return so clients can avoid unnecessary retries.
Design server-side idempotency handling for a mobile payment API. Provide pseudocode or SQL-level approach for accepting an Idempotency-Key header, storing request state and response, returning cached response for duplicates, handling concurrent same-key requests (race conditions), expiry policy for idempotency entries, and pruning. Explain trade-offs of locking vs optimistic upsert and how to scale the idempotency store.
Describe a secure refresh token flow for mobile apps. Explain the roles of access and refresh tokens, refresh token rotation, secure storage on device, refresh endpoint behavior, refresh failure handling (forced re-auth), and common pitfalls such as long-lived refresh tokens or refresh token reuse.
Unlock Full Question Bank
Get access to all 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.