11 React Interview Questions Indian Freshers Get Wrong
11 React interview questions that trip up Indian freshers — from Virtual DOM to Server Components. Real answers hiring managers expect, not textbook definitions.

11 React Interview Questions Indian Freshers Get Wrong
Naukri lists over 19,000 React Developer vacancies in India. Between you and that ₹3.6–8.2L salary range lies a technical interview where the same questions trip up freshers. Here are 11 React interview questions that catch Indian freshers off guard — and how to answer them.
1. What happens when you call setState inside render?
Calling setState in render triggers an infinite loop. React throws "Maximum update depth exceeded." State updates belong in event handlers or useEffect — never in render.
2. Why does React.memo not help if you pass a new callback prop?
React.memo does shallow prop comparison. If you pass a new function reference every render, the comparison fails and the component re-renders anyway. Wrap callbacks in useCallback to keep references stable. React.memo, useCallback, and useMemo only work together.
3. Explain the difference between controlled and uncontrolled components
A controlled component gets its value from React state (value={text} with onChange). An uncontrolled component lets the DOM manage it — you read via ref when needed. Controlled gives you validation power (disable submit until valid, format input live). Use uncontrolled only for inputs where you don't need every keystroke, like file uploads.
4. What's wrong with using array index as a key?
Using key={index} works for static lists but breaks on reorders, inserts, or deletes. React uses keys to match elements between renders — if you remove item 2 from a 5-item list, index 2 now points to what was item 3, causing state bleed-through. Use a stable unique ID from your data for dynamic lists.
5. When would you use useReducer over useState?
Use useReducer when multiple state fields update together or when the next state depends on the previous one non-trivially. A login form with email, password, loading, and error fields changing together is a good fit. A simple toggle is not. If your setState calls have scattered conditional logic, switch to useReducer.
6. What is the dependency array in useEffect and what happens if you omit it?
No array → runs after every render. Empty [] → runs only on mount. Array with values [id] → runs on mount and when id changes. The trap: if you reference a variable inside the effect but omit it from the array, you get a stale closure. ESLint's exhaustive-deps catches this — fix the code, don't disable the rule.
7. How does the Virtual DOM actually work?
The Virtual DOM is a JavaScript object tree representing the UI. When state changes, React builds a new tree, diffs it against the old one (reconciliation), and patches only the changed DOM nodes. It isn't faster than direct DOM manipulation — it's fast enough while keeping code declarative. Mention reconciliation and diffing, not just "it's faster."
8. What is prop drilling and how do you fix it?
Prop drilling is passing data through layers that don't need it. The fix: React Context for global data (auth, theme), or Zustand/Redux for frequently-updating state. For freshers, Context API handles 90% of cases — no extra dependency. Save Redux for when multiple components update shared state independently.
9. Explain React 18's automatic batching
Before React 18, only event handler updates were batched. React 18 batches all updates — including setTimeout and Promises — into single re-renders. Fewer renders, smoother UI. Use flushSync() to opt out, but you rarely need to.
10. What are React Server Components and when should you use them?
Server Components run on the server only, send zero JavaScript to the client, and can access databases directly. Use them for data-heavy pages without interactivity. Client components handle state and events. Most Indian companies haven't adopted them yet, but knowing they reduce bundle size is enough for fresher interviews.
11. How would you debug a React component that renders too often?
Interviewers want your process, not memorized rules. Step 1: Wrap in React.memo — did renders drop? Step 2: Check if props are new references every render — use useCallback/useMemo. Step 3: Use React DevTools Profiler. Step 4: Check context — a changing Provider value re-renders all consumers. The winning answer: "I profile first, then fix the cause."
Quick Preparation Checklist
- Practice
useState,useEffect,useContextfrom memory — no notes - Build a small app (todo list with filters) and explain each rendering decision out loud
- Read the official React docs — interviewers can tell YouTube learners from doc readers
- Review your projects: can you explain why you chose Context over Redux?
- Practice with PrepFox's mock interview to rehearse verbally — saying it out loud differs from reading
Bottom Line
React interviews test understanding, not memorization. Candidates who get offers explain why a pattern exists. Pick 3-4 questions you're weakest on, write the answer without looking, then compare. If your resume lists React, own these answers. Career counselling can help map which React roles match your level.
Ready to put this into practice?
Practice mock interviews, build your resume, and get expert feedback — all on PrepFox.
More from PrepFox Blog
How to Crack Aptitude Interview Questions in Placements
How to crack aptitude interview questions in Indian placements: quant, reasoning and verbal sections, an 8-week plan, and test-day strategy.
9 Questions to Ask the Interviewer That Impress HR
Interview questions to ask the interviewer: 9 smart questions that impress Indian HR, what each one signals, and what never to ask in round one.
How to Answer Civil Interview Questions as a Fresher
How to answer civil interview questions as a fresher in India: slump test, foundations, cement tests and salary data for site engineer offers.
