React Interview Question
Core React Fundamentals (Must be strong)
- Explain how React works under the hood.
- What is the Virtual DOM and why does React use it?
- What happens when you call
setStateor a state setter in hooks? - Difference between functional and class components (and why functional dominates today).
- What are React Hooks and why were they introduced?
- Rules of Hooks — why are they important?
- What is reconciliation in React?
- How does React decide to re-render a component?
- What is JSX and how is it transformed?
- Controlled vs uncontrolled components.
Hooks Deep Dive
- Explain
useStatebehavior in detail. - When does
useEffectrun? Explain dependency array deeply. - Common mistakes with
useEffect. - Difference between
useEffect,useLayoutEffect. - What is
useRefused for besides DOM references? - How does
useMemodiffer fromuseCallback? - When should you NOT use memoization?
- Explain custom hooks — when and why to create them.
- Can hooks replace Redux? Why or why not?
- How do you share logic across components without HOCs?
State Management
- When do you use Context API vs Redux?
- What problems does Context API NOT solve?
- Explain Redux flow (actions → reducers → store).
- What is Redux middleware?
- Have you used Redux Toolkit? Why is it preferred?
- How do you handle global vs local state decisions?
- What is state normalization?
- How do you manage server state vs UI state?
Performance Optimization
- What causes unnecessary re-renders in React?
- How do you prevent re-renders in large applications?
- Explain
React.memoand its limitations. - How does referential equality affect performance?
- What is list virtualization? Have you used it?
- How do you optimize large lists in React?
- What are expensive renders and how do you identify them?
- How do you measure React performance issues?
- What tools do you use (React DevTools Profiler, Lighthouse)?
- What is code splitting in React?
Component Design & Architecture
- How do you design reusable components?
- What makes a component “badly designed”?
- Presentational vs container components.
- How do you structure a large React codebase?
- How do you manage shared component libraries?
- How do you handle prop drilling?
- What is composition in React?
- When would you avoid creating a reusable component?
- How do you design scalable UI systems?
Lifecycle & Rendering Behavior
- Explain React rendering lifecycle.
- What triggers a re-render?
- What happens during hydration?
- How does React batch state updates?
- What is stale closure in React?
- Why does state sometimes not update immediately?
- What is concurrent rendering (React 18)?
- How does Suspense work?
- What are transitions in React (
startTransition)?
API Handling & Async Logic
- How do you handle API calls in React?
- What are race conditions in API calls?
- How do you cancel API requests in React?
- How do you handle loading/error states globally?
- Difference between React Query vs manual fetching.
- How do you cache API responses?
- How do you prevent duplicate API calls?
- How do you handle pagination/infinite scroll?
Forms & Events
- Controlled vs uncontrolled forms — when to use each?
- How do you manage large forms in React?
- What libraries have you used (Formik, React Hook Form)?
- How do you validate forms efficiently?
- How does event delegation work in React?
- Synthetic events in React — what are they?
Advanced React Concepts
- What are portals and when do you use them?
- What is error boundary and how is it implemented?
- How do error boundaries differ from try/catch?
- What are higher-order components (HOCs)?
- Render props pattern — still relevant?
- What are fragments and why are they useful?
- What are React refs used for in real projects?
- What is hydration mismatch?
- What is React Fiber architecture (high level)?
- What are React Server Components (conceptual)?
Debugging & Real-World Scenarios
- Your component is re-rendering too often — how do you debug it?
- API is called multiple times unexpectedly — why?
- UI flickers on navigation — what could be wrong?
- Memory leak in React app — how would you find it?
- App slows down after scaling — what do you check first?
- State updates not reflecting immediately — why?
- Why is useEffect running twice in development?
- You see infinite render loop — how do you fix it?
Testing in React
- How do you test React components?
- Unit vs integration testing in React apps.
- What is React Testing Library philosophy?
- How do you mock API calls?
- What do you avoid testing in React?
- What are snapshot tests and their drawbacks?
- How do you test hooks?
- How do you test async behavior?
Code Quality & Best Practices
- How do you enforce code quality in React projects?
- What linting rules are most important?
- How do you structure reusable hooks?
- How do you prevent spaghetti React code?
- What naming conventions do you follow?
- How do you handle TypeScript with React?
- How do you ensure scalable folder structure?
System Thinking / Design Questions
- Design a reusable component library.
- Design a dashboard with real-time data updates.
- How would you architect a multi-tenant React app?
- How do you design a design system in React?
- How would you migrate a large legacy React app?
- How would you implement role-based UI rendering?
- How would you design a performant infinite feed?
Behavioral / Experience-Based
- What is the most complex React bug you solved?
- What performance improvement had the biggest impact?
- How do you handle disagreements in code reviews?
- Have you mentored junior React developers?
- What architectural decision are you most proud of?
- What mistake taught you the most in React?
- How do you stay updated with React changes?
Expert-Level / Deep React
- Explain React reconciliation algorithm in detail.
- What is fiber tree and how does it work?
- How does React schedule rendering work?
- Why is React “not reactive” in the traditional sense?
- How does concurrent mode change rendering behavior?
- What is lane-based scheduling in React?
- How does React handle priority updates?
- What happens internally when context changes?
Comments
Post a Comment