Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Interview Questions

This document is a comprehensive list of React interview questions, organized by category and difficulty level — ideal for interview prep, self-assessment, or team training.

React Basics

  1. What is React?
  2. Why use React instead of plain JavaScript?
  3. What are the main features of React?
  4. What is JSX?
  5. What is the virtual DOM?
  6. What are components in React?
  7. Explain the difference between functional and class components.
  8. What are props in React?
  9. How does state work in React?
  10. How do you create a React app?
  11. What is create-react-app?
  12. What is a fragment in React?
  13. What is the role of the render() method?
  14. How do you pass data from parent to child components?
  15. What is prop drilling?
  16. How do you avoid prop drilling?
  17. What are default props?
  18. What is the purpose of key in React lists?
  19. How does conditional rendering work?
  20. How do you handle events in React?
  21. How do you bind event handlers in class components?
  22. What are inline styles in React?
  23. What is the difference between a React element and a React component?
  24. How is re-rendering handled in React?
  25. What is the children prop?

Hooks and Functional Components

  1. What are React Hooks?
  2. Why were hooks introduced?
  3. What is useState?
  4. What is useEffect?
  5. What’s the difference between useEffect with and without dependency array?
  6. What are the rules of hooks?
  7. What is useContext?
  8. What is useRef and how is it used?
  9. What is useCallback?
  10. What is useMemo?
  11. What is useReducer?
  12. How do you create a custom hook?
  13. How can you share logic between components?
  14. When does useEffect run?
  15. How do you clean up in useEffect?
  16. Can you call a hook inside a loop or condition?
  17. What happens if you update state during rendering?
  18. How do you prevent unnecessary re-renders?
  19. What's the difference between useRef and createRef?
  20. How does useLayoutEffect differ from useEffect?
  21. What are controlled vs uncontrolled inputs in React?
  22. How do you persist data between renders?
  23. Can you explain the use of useImperativeHandle?
  24. What is lazy state initialization in useState?
  25. What are common performance mistakes with hooks?

State Management

  1. How is state different from props?
  2. When should you use component state?
  3. What is lifting state up?
  4. What are global state management options in React?
  5. What is Context API?
  6. When should you use Redux?
  7. What are the pros and cons of Redux vs Context API?
  8. What is Redux Toolkit?
  9. What are actions, reducers, and store in Redux?
  10. How does the Provider work in Redux?
  11. What is middleware in Redux?
  12. How does Redux handle async logic?
  13. What is useSelector and useDispatch?
  14. What are thunks in Redux?
  15. What is reselect?
  16. Can you use both Redux and Context together?
  17. What is Zustand? How is it different from Redux?
  18. What is MobX?
  19. What are atoms in Recoil?
  20. When is it okay to use local component state only?

Routing and Navigation

  1. What is React Router?
  2. What is the difference between BrowserRouter and HashRouter?
  3. What is Link vs a tag?
  4. How do you define routes in React Router v6?
  5. What is a dynamic route?
  6. How do you navigate programmatically?
  7. What is useNavigate?
  8. How do you handle 404 pages?
  9. What is nested routing?
  10. What are route parameters?
  11. How do you extract parameters using useParams?
  12. What is a layout route?
  13. What is Outlet in React Router?
  14. How do you protect a route (auth)?
  15. How does route-based code splitting work?

Performance and Optimization

  1. What is React.memo?
  2. What is PureComponent?
  3. How do you avoid unnecessary re-renders?
  4. How do you optimize large lists?
  5. What is lazy loading in React?
  6. What is React.lazy and Suspense?
  7. How do you chunk code in React?
  8. What is useCallback vs useMemo?
  9. What is the React Profiler?
  10. What are the most common React performance pitfalls?
  11. How does reconciliation work in React?
  12. What causes React to re-render?
  13. What is the difference between shallow and deep comparison?
  14. How can React dev tools help with performance?
  15. How does memoization help performance?
  16. When should you not use React.memo?
  17. What are render props and how do they impact performance?
  18. What is the difference between class-based and functional performance?
  19. What is the cost of context re-renders?
  20. How do you optimize re-renders with React.memo and hooks?

Advanced Concepts

  1. What are Higher-Order Components (HOCs)?
  2. What are render props?
  3. What is an Error Boundary?
  4. How do you create an Error Boundary?
  5. What is forwardRef?
  6. What is reconciliation?
  7. How do you manage focus in forms?
  8. What is the React Fiber architecture?
  9. How is React concurrent mode different?
  10. What is Suspense for data fetching?
  11. What are portals in React?
  12. What are the advantages of functional components over class components?
  13. How do you use TypeScript with React?
  14. What is server-side rendering (SSR)?
  15. What is hydration in React?
  16. What is Next.js and how does it relate to React?
  17. How does React Native differ from React?
  18. What are React lifecycles in class components?
  19. How do lifecycle methods map to hooks?
  20. What is reconciliation and key diffing in lists?

Testing and Debugging

  1. How do you test React components?
  2. What is React Testing Library?
  3. How does RTL differ from Enzyme?
  4. What are mock functions in Jest?
  5. How do you mock API calls?
  6. How do you test form input and submission?
  7. How do you test components that use hooks?
  8. What is the role of act() in testing?
  9. What are best practices for testing React apps?
  10. How do you test context?
  11. How do you simulate events in tests?
  12. How do you handle async testing?
  13. What is snapshot testing?
  14. What are common testing pitfalls in React?
  15. How do you debug a React app in production?

Project / Behavioral

  1. Describe a React app you built.
  2. What was a challenging React bug you fixed?
  3. How do you decide which state management approach to use?
  4. How do you structure large-scale React apps?
  5. How do you handle code reuse in React?
  6. How do you manage large forms in React?
  7. What tradeoffs have you made in past React projects?
  8. What’s your preferred folder structure in a React project?
  9. How do you handle environment variables in React?
  10. How do you ensure accessibility in your React components?

License

MIT — use freely, but give credit if you’re publishing it elsewhere.

About

React Interview Questions

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors