Top 5 React Interview Questions
Browse 5 real-world technical and behavioral interview questions about React. Review scenarios, edge cases, and architectural best practices.
Angular, Vue and React are answers to the same problems. Compare how each handles change detection, reactivity and dependency injection.
Each must decide what to re-render when data changes, how derived values stay correct, and how a component gets a dependency it did not create. Angular answers with dirty checking now moving to signals plus a hierarchical injector, Vue with proxy-based per-property tracking, React with convention plus memoisation.
A user deletes the second row of an editable list and the wrong row now shows the text they typed. What is going on?
A React index key bug happens when list positions are used as identity. Deleting, sorting or filtering shifts positions, so React reuses the wrong component instance and local state appears beside the wrong row.
How do you architect a React Server Components migration without accidentally forcing the entire component tree back to the client?
React Server Components differ from SSR because they keep server-only work out of the client bundle instead of only rendering HTML on the server. The migration works when the use client boundary stays low and data fetching stays on the server.
You wrapped the component in React.memo and it still re-renders on every keystroke. Why?
React.memo still re-renders when shallow prop comparison fails because parents recreate objects, callbacks or children, or when context and local state update. Stabilise references with useMemo/useCallback only where it removes real render cost.
Why does my useEffect run twice on mount?
React useEffect runs twice on mount in development when Strict Mode deliberately runs one extra setup-cleanup-setup cycle. It does not happen in production builds, and the fix is to write the cleanup the effect was missing rather than to guard the effect or remove Strict Mode.