React State and Data Flow Interview Questions
State and data flow are core React interview topics. Here are the common questions and how to answer them.
React State and Data Flow Interview Questions
State and data flow are core React interview topics. Here are the common questions and how to answer them.
What is the difference between props and state?
Props are inputs from a parent, read-only in the child. State is internal data the component owns and can change, triggering re-renders. Props are external; state is internal.
When do you lift state up?
When two or more siblings need the same data and must stay in sync. Lift it to their common parent, which owns the state and passes it down to both as props, creating a single source of truth.
When do you use Context vs Redux?
Context for widely-shared, rarely-changed data like auth and theme. Redux for complex, frequently-updated shared state with many interactions. Reach for Redux only when Context is genuinely insufficient.
How do you avoid unnecessary re-renders?
By keeping state local where possible, stabilizing prop references with useMemo and useCallback, using React.memo for components that re-render often with the same props, and splitting Contexts by change rate.
What is the single source of truth principle?
Each piece of data should have one owner. Do not duplicate data between props and state, or across stores. Duplication causes sync bugs when one copy updates and another does not.
How to Answer Well
Connect state decisions to the problems they solve. Interviewers want to hear you choose tools based on the app's actual complexity, not by default, and that you understand the trade-offs.
The Takeaway
Know props vs state, when to lift state, Context vs Redux, how to avoid unnecessary re-renders, and the single source of truth principle. Connect decisions to the problems they solve and show you choose tools based on actual complexity.
Props are inputs from a parent, read-only in the child. State is internal data the component owns and can change, triggering re-renders. Props are external; state is internal.
When two or more siblings need the same data and must stay in sync. Lift it to their common parent, which owns the state and passes it down to both as props, creating a single source of truth.
Context for widely-shared, rarely-changed data like auth and theme. Redux for complex, frequently-updated shared state with many interactions. Reach for Redux only when Context is genuinely insufficient.
Keep state local where possible, stabilize prop references with useMemo and useCallback, use React.memo for components that re-render often with the same props, and split Contexts by change rate to prevent unrelated re-renders.
Each piece of data should have one owner. Do not duplicate data between props and state, or across stores. Duplication causes sync bugs when one copy updates and another does not.
Ready to master Node.js completely?
Want to upskill yourself, crack your next interview, and get your dream job? Join our comprehensive course to dive deeper with high-quality video tutorials, solve interview questions, and a premium community.
Master Node.js
Want to upskill yourself, crack your next interview, and get your dream job? Join our comprehensive course.

