Technical Mid Level

When would you use React context versus a state management library like Redux or Zustand? How do you decide?

Quick Tip

Show you understand the trade-off: "I use context for auth and theme. For complex app state with frequent updates, I reach for Zustand because it avoids the re-render problem and has a simpler API than Redux."

What good answers include

Context is good for low-frequency updates shared across many components (theme, auth, locale). It is poor for high-frequency updates because every consumer re-renders. Redux/Zustand are better for complex state with many updates, devtools support, and middleware. Strong candidates discuss the re-render cost of context, the complexity cost of Redux, and newer lightweight options like Zustand or Jotai.

What interviewers are looking for

Tests practical state management experience. Candidates who put everything in Redux or everything in context are showing a lack of nuance. Look for the ability to match tools to problems.

← All React questions