React State Management
Question Variations
- "When should you use React Context instead of a dedicated state management library like Redux or Zustand?"
- "What are the performance implications of using React Context for frequently updated state?"
- "How does Zustand solve the 'prop drilling' problem differently than Redux?"
- "What is the difference between 'local state' and 'global state,' and how do you decide where a piece of state belongs?"
Why This Is Asked
State management choices have a direct impact on application performance and maintainability. Interviewers want to see that you understand the re-render implications of Context, know when to reach for external libraries, and can articulate the trade-offs.
Key Concepts
- Context API: built-in, zero dependencies, ideal for low-frequency data (theme, auth, locale)
- Context triggers re-renders for all consumers when the provider value changes — no selector support
- State libraries (Zustand, Redux): use subscription models with selectors to prevent unnecessary re-renders
- Zustand/Jotai are minimal-boilerplate alternatives to Redux for most use cases
- The decision depends on update frequency, state complexity, and whether you need middleware/devtools
Question Variations
- “When should you use React Context instead of a dedicated state management library like Redux or Zustand?”
- “What are the performance implications of using React Context for frequently updated state?”
- “How does Zustand solve the ‘prop drilling’ problem differently than Redux?”
- “What is the difference between ‘local state’ and ‘global state,’ and how do you decide where a piece of state belongs?”