InterviewStack.io LogoInterviewStack.io

Frontend Backend Integration Through APIs Questions

Understanding how frontend components interact with backend APIs using HTTP requests (fetch, axios, etc.), handling asynchronous responses and errors, managing data flow from API responses to UI updates. Ability to design APIs that frontend needs and implement corresponding client-side code to consume them properly.

MediumTechnical
53 practiced
Design and describe both backend API and frontend behavior to implement optimistic UI updates for a 'like' toggle on posts. The client should immediately reflect the new state, send the API request to /api/posts/:id/like, handle rollback if the request fails, and the backend must be idempotent and return the canonical like count. Show endpoint design (method, body, response) and client pseudocode that handles optimistic state, temporary IDs, and reconciliation.
EasyTechnical
52 practiced
As a full-stack developer, design a minimal REST API contract for a Todo application. Provide endpoints, HTTP methods, example request and response JSON for creating a todo, listing todos with pagination parameters, partially updating a todo, and deleting a todo. Include validation rules (required fields, field formats), example status codes, and a small JSON schema snippet for create/update so frontend and backend can align on the contract.
HardTechnical
55 practiced
Design a machine- and human-friendly API error format that includes correlation IDs, machine-readable error codes, user-facing messages, and optional developer debug info controlled by environment. Describe how you propagate a correlation ID from the browser through backend services and external calls, how you index logs and traces to find root causes, and how you expose errors to SREs without leaking sensitive data to users.
EasyTechnical
44 practiced
Explain how Cross-Origin Resource Sharing (CORS) works when your frontend served from https://app.example.com calls a backend API at https://api.example.com. Describe what triggers a preflight (OPTIONS) request, which response headers the server must return to permit the request (including credentialed requests), and step-by-step debugging techniques you would use when the browser reports CORS errors in the console.
EasyTechnical
51 practiced
Write JavaScript code (browser environment) that performs a GET request to /api/resource using fetch, implements up to 3 retries with exponential backoff (e.g., 500ms, 1000ms, 2000ms), does not retry on 4xx responses, and supports cancellation via AbortController. Show the retry logic and how errors are surfaced to the caller.

Unlock Full Question Bank

Get access to hundreds of Frontend Backend Integration Through APIs interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.