engineering · Fresher-friendly
React Developer interview questions on hooks, state management, virtual DOM, and performance optimization for Indian product companies.
What is the difference between state and props in React?
Tip: Props are read-only inputs passed from parent to child — they flow down. State is mutable data owned by a component that triggers re-renders when changed. Changing a prop inside the receiving component is a bug.
What are React Hooks? Name and describe the five most important ones.
Tip: useState: local state. useEffect: side effects. useContext: consume context. useRef: mutable ref without re-render. useMemo/useCallback: memoisation. Hooks replaced class lifecycle methods — name whichever you use most and explain why.
Explain useEffect and its dependency array. What happens with an empty array vs no array?
Tip: No dep array: runs after every render. Empty `[]`: runs once after mount. With deps: runs when any dep changes. Return a cleanup function to cancel subscriptions/timers. Stale closure in deps is the most common bug.
What is Context API? When would you use it over Redux?
Tip: Context avoids prop drilling for low-frequency data (theme, locale, auth user). It re-renders all consumers when context value changes. Use Redux (or Zustand) when you have complex state with many updates, time-travel debugging, or middleware needs.
What is React.memo and useMemo? When do they help and when do they hurt?
Tip: React.memo prevents re-rendering a component if props are shallowly equal. useMemo memoises expensive computed values. Both add overhead from the comparison itself — only use when profiling proves unnecessary re-renders are the bottleneck.
How does React reconciliation work? What is the "key" prop and why must it be stable?
Tip: React diffs virtual DOM trees using a heuristic O(n) algorithm. `key` tells React which list item maps to which DOM node across renders. Non-unique keys cause incorrect DOM updates. Index-as-key breaks when list order changes — use a stable entity ID.
What is code splitting in React? How do you implement lazy loading?
Tip: Code splitting breaks the JS bundle into chunks loaded on demand. Use `React.lazy(() => import("./Component"))` with a `<Suspense fallback={...}>` wrapper. Routes are the best split points. Reduces initial bundle size and time-to-interactive.
Tell me about the most complex React component or feature you built. What made it hard?
Tip: Pick something genuinely complex: virtual list, drag-and-drop, real-time collaborative editor, complex form with nested validation. Describe the specific technical challenge and how you solved it.
A React page renders 500+ items and scrolls sluggishly. What do you do?
Tip: Profile with React DevTools Profiler to confirm the cause. Solutions: virtualise the list (react-virtual, react-window), paginate, or use incremental rendering. If individual items are expensive, add React.memo. Measure before and after.
How do you test a React component? What is the difference between unit and integration testing?
Tip: Use React Testing Library (RTL): query by accessible role, not implementation detail. Unit test: isolates one component with mocked dependencies. Integration test: renders a component tree, tests real interactions. RTL philosophy is to test behaviour, not implementation.
What is prop drilling and how do you avoid it?
Tip: Prop drilling: passing props through many layers that don't use them. Avoid with: Context API (for low-frequency global data), component composition (pass components as children/props), or state management like Zustand.
React vs Vue — what are the key architectural differences and when would you choose each?
Tip: React: library with explicit state management choices, JSX, large ecosystem, flexible. Vue: opinionated framework, HTML templates, simpler learning curve. React dominates Indian product companies. Be honest about your experience.
Practice, not just reading
Upload your resume and practice a full React Developer mock interview with AI-generated questions and rubric-based scoring across 5 dimensions — free to start.