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 ../07_state_managers/ 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 ../../backend/12_protocols/http/03_http_semantics_and_caching.md), 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.
Cross-references
- HTTP semantics, status codes, caching (
Cache-Control/ETag): ../../backend/12_protocols/http/03_http_semantics_and_caching.md - HTTP versions and HOL blocking: ../../backend/12_protocols/http/02_http_versions.md
- Resilience patterns (backend): ../../system_design/02_resilience/