State Management & Data Fetching
Where app data lives, how it changes, and how it stays in sync with the server.
Backend Engineer
Junior
Write correct code, ship small changes safely, ask good questions.
- Single Source of TruthEach piece of data has exactly one authoritative owner.
Mid-level
Own a feature end to end without hand-holding.
- Stale-While-RevalidateShowing cached data immediately while fetching fresh data in the background.
Frontend Engineer
Junior
Build UI that works, ship small changes safely, ask good questions.
Core: start here
- Derived StateComputing values from state instead of storing duplicates.
- Loading, Error and Empty StatesDesigning every state of async UI, not just success.
3 more junior concepts
- Local vs Global StateKeeping state close to where it's used unless it's truly shared.
- Single Source of TruthEach piece of data has exactly one authoritative owner.
- State ManagementDeciding where data lives in an app and how it changes.
Mid-level
Own a feature end to end without hand-holding.
Core: start here
- Data Fetching LibrariesTools like TanStack Query and SWR that cache and sync server data.
- Form State ManagementValues, touched fields, errors and submission state.
- Global StoreA central container for shared app state, like Redux or Zustand.
- Server State vs Client StateCached copies of server data vs purely UI state.
- URL as StateKeeping filters, tabs and pagination in the URL so it can be shared.
- Optimistic UpdateUpdating the UI before the server confirms, and rolling back on failure.
4 more mid-level concepts
- Flux / Redux PatternOne-way data flow with actions, reducers and a single store.
- ReducerA pure function from (state, action) to the new state.
- Client Cache InvalidationKnowing when cached server data is out of date.
- Stale-While-RevalidateShowing cached data immediately while fetching fresh data in the background.
Senior
Own an app's architecture, performance, and failure modes.
- State Machines for UIModeling UI as explicit states and transitions, e.g. with XState.
- Offline-FirstApps that work without a network and sync later.