APIs & Data Fetching — Senior Interview Prep
On this page3
- Files
- What a senior is expected to frame
- Related
APIs & Data Fetching — Senior Interview Prep
The other half of a fullstack interview: how the client consumes APIs. Choice of protocol, request lifecycle, caching layer, optimistic UX, real-time channels, and the failure modes that only show up under flaky networks and concurrent users.
Files
What a senior is expected to frame
- Server state ≠ client state. Server-fetched data has a cache, a freshness model, a refetch schedule, and rules for when it’s stale. Treat it differently from local UI state — most “Redux complexity” disappears once you separate the two. See State Management — Senior Interview Prep for the state-management side.
- Failure is the design. Network requests fail. Servers throw 5xx. Users double-click. Tabs sleep mid-request. The interview answer always names: timeout, retry policy (and which methods are retryable — see HTTP semantics and caching), idempotency, abort, and the UX during each.
- Latency budget shapes architecture. A typeahead has a different budget than a checkout. Pagination strategy, debounce, prefetching, optimistic UX — all flow from the budget.
Contents
9
- REST vs GraphQL vs tRPC — When Each Wins 4 REST is the universal default — HTTP semantics, every cache layer understands it, every client supports it.
- TanStack Query and server state 8 Teams put API responses in Redux, write three actions and a reducer per endpoint, and call it state management.
- Optimistic Updates and Rollback 4 An optimistic update writes the expected post-mutation state to the cache before the server confirms it.
- Pagination — Offset vs Cursor, and Infinite Queries 4 Offset pagination (?page=3&size=20) is dead simple but breaks under high write traffic — pages shift as items are inserted/deleted, and skipping deep pages…
- Race conditions and AbortController 7 The user types ab, then abc. Two requests go out. ab's response comes back second and the list now shows results for a query the user has already moved past.
- Retries, Backoff, and Idempotency (from the Frontend) 5 A retry policy without an idempotency contract is a duplicate-data bug.
- WebSockets — Integration, Reconnection, and Real-Time UX 4 WebSockets give you a bidirectional, persistent, full-duplex connection over TCP — the right choice for chat, presence, collaborative editing, live…
- Streaming an LLM answer into a React UI 4 How do you stream an LLM response from a FastAPI backend into a React UI so tokens render smoothly and Stop actually stops the model?
- File Uploads — Multipart, Presigned S3, Chunked, Resumable 5 Three patterns, ordered by file size and reliability requirements: