How do I choose state management for interviews?
Local state for one component, lift for siblings, Context for widely-shared rarely-changed data, Redux for complex frequently-updated shared state, and React Query for server state. Match the tool to the complexity, not by default.
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in A React Interview Cheat Sheet of Concepts You Must Know
JSX, components, hooks and their rules, useState and useEffect, the virtual DOM and reconciliation, keys for lists, performance with useMemo, useCallback, and React.memo, and state management by complexity, from local to Context to Redux.
Call hooks at the top level only, never in loops or conditions. Only call hooks from React functions. These rules exist because React tracks hooks by call order, and breaking the order causes subtle bugs.
It runs side effects after render. Dependency array: empty runs on mount, with values runs on change, missing runs every render. Return a cleanup function for subscriptions and timers to prevent leaks and stale updates.
Still have questions?
Browse all our FAQs or reach out to our support team
