As asked
Your React app started with useState and now has prop-drilling five levels deep, plus shared server data that multiple components need. When do you reach for a state manager, and which one do you pick and why?
Sample answer outline
Candidate should distinguish server state (React Query or SWR are the right tool, not Redux) from client UI state (Context or Zustand for simple cases, Redux Toolkit for complex cross-cutting state). Strong answers name the smell that triggers the switch: prop-drilling past two levels for server data, cache invalidation bugs, or optimistic update complexity. Avoid candidates who reach for Redux reflexively.
Expect these follow-ups
- How does React Query know when to refetch data and how do you override that behavior?
- You have global UI state (sidebar open/closed) and remote server state in the same Redux store. Is that a problem?