Module 9 · 1 chapters

State Management

State management is the backbone of every frontend app — SDE-2 interviews expect you to distinguish local vs global vs server state and pick the right tool without over-engineering.

This module covers useState and useReducer, Redux Toolkit, Zustand, Context API, React Query, MobX, and Jotai — plus single source of truth, immutable updates, selectors, middleware, and architecture patterns.

The goal is to pick the smallest tool that fits: local state for UI, React Query for server data, Zustand or Redux only when multiple distant components genuinely need shared mutable state.

Compare Redux Toolkit, Zustand, Context API, React Query, MobX, and Jotai with bundle size, boilerplate, DevTools, and re-render behavior — plus patterns like selectors, middleware, and optimistic updates.

Chapters in this module

  1. State ManagementLocal, global, and server state in React: useState, useReducer, Redux Toolkit, Zustand, Context API, React Query, MobX, and Jotai — library comparison, architecture patterns, and clear rules for when to use each.