Question presented to candidate:
"How would you load data in a React app? Take me through the options and how you would choose."
What a strong answer should cover:
React ships no data-fetching solution. That is deliberate — it is the common-abstraction principle. The question is really which tool you bring.
The four realistic options, roughly in order of preference: a Server Component, a query library (TanStack Query, SWR), use() with Suspense, and a hand-rolled useEffect.
Why the effect version is the last resort despite being the one everyone learns first: you must hand-roll loading and error state, race protection, caching, deduplication, refetching, and invalidation.
Server state is not UI state. It is a cache of something that lives elsewhere, so it needs staleness handling rather than storage.
Waterfalls: fetching sequentially when the requests are independent. Fetch in parallel, or move the fetch up.
Render-as-you-fetch versus fetch-on-render, and why starting the request before rendering matters.
The framework answer: in Next.js App Router, an async Server Component is usually correct and removes the client-side problem entirely.
Clarifying questions expected:
"Is there a framework with server rendering, or is this a pure client SPA?"
"Does this data need caching, refetching, or optimistic updates?"
"Who else needs the same data?"
Code / implementation expected: Yes — the effect version done properly, and ideally the library version for contrast.
data fetchinguseEffectapiasynchronous
02
02
Attempt it yourself
Sketch your approach before reading the solution — that's what interviews test.
Nudge consolestandby
Stuck? Beam a request up — the console returns a conceptual nudge that guides your logic without spoiling the implementation.
03
03
Study the solution
Target Audience: Engineers preparing for React interviews — assumes useEffect.
Difficulty: Medium
How to read this doc: Concepts are explained in plain language first, then tagged with 📌 Interview term:. This doc is the decision landscape; <a href="PASTE_ASYNC_OPS_URL_HERE" tar
Solution ready — 2 min read
Classified // press E to declassify
04
04
Explore the playground snippets
A correct hand-rolled fetch, and the same thing with a tiny cache