What problem does a global state manager solve that useState alone cannot?
Global state: passing props down many levels (prop drilling) becomes unmanageable. A store (Redux, Zustand, Jotai) places shared data in one place that any component can read or update directly.
2 / 5
What is the flux pattern underlying Redux?
Flux: data flows in one direction. A dispatched action describes what happened; a pure reducer computes the next state from the current state + action; the store notifies subscribers; the view re-renders.
3 / 5
What is a selector in a state management library?
Selector:const total = useSelector(state => state.cart.reduce(...)) isolates derived data. Memoized selectors (Reselect) recalculate only when inputs change, avoiding unnecessary re-renders.
4 / 5
What distinguishes Zustand from Redux?
Zustand: it uses a simple store created with create() and read via hooks, skipping Redux's action/reducer ceremony. The entire store and its updaters live in one place, making it simpler for small-to-medium apps.
5 / 5
What is atomic state as implemented by Jotai or Recoil?
Atomic state: each piece of data is an atom. Components subscribe only to the atoms they use, so an atom update re-renders only its subscribers rather than a whole subtree, improving granularity.