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.
EasyTechnical
44 practiced
In JavaScript (ES2018), write an async function using fetch to GET /api/users. The function should:- check response.ok and throw a descriptive error for non-2xx responses- parse and return the JSON body- catch network errors and rethrow as an ApiError with status (if available) and messageProvide the implementation for apiGetUsers().
HardSystem Design
42 practiced
Design the client-server sync protocol for an offline-first PWA that supports creating, editing and deleting resources while offline and synchronizes on reconnect. Explain operation representation (operation log vs state sync), conflict detection and resolution strategies (LWW, merge, CRDT), API endpoints for delta sync vs full sync, and UX signals for sync status and conflicts.
EasyTechnical
55 practiced
Map the most appropriate HTTP status code for each scenario and explain your reasoning:1) Client successfully creates a new resource.2) Client submits invalid form data with field-level errors.3) Request without authentication to a protected endpoint.4) Requested resource by id does not exist.5) Backend experiences an unexpected database error.Also explain when to use 422 vs 400 and 401 vs 403.
MediumTechnical
61 practiced
Write a JavaScript function retryFetch(url, options, { maxRetries, initialDelay, maxDelay }) that retries on network errors and 5xx responses. Implement exponential backoff with jitter, support AbortController cancellation, and avoid retrying non-idempotent methods like POST by default. Provide code.
MediumTechnical
45 practiced
In TypeScript, write a generic function apiFetch<T>(url: string, options?: RequestInit): Promise<T> that:- uses fetch- throws a typed ApiError containing HTTP status and parsed error body for non-2xx responses- parses JSON and returns typed TInclude type definitions for ApiError and an example of usage with an interface for the response.
Unlock Full Question Bank
Get access to hundreds of Frontend Backend Integration Through APIs interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.