React_Interview_Questions
React_Interview_Questions
---
1. General React.js Questions
1. What is React, and what are its main features?
2. What is the difference between class components and functional components?
3. What are props and state? How do they differ?
4. What is the significance of keys in React?
5. What are React Fragments, and why are they used?
6. What are Higher-Order Components (HOCs)? Provide an example.
---
2. React Hooks
### Core Hooks
1. What are React Hooks, and why were they introduced?
2. Explain useState with an example.
3. What is the purpose of useEffect, and how is it different from lifecycle
methods?
4. What is useMemo, and when would you use it?
5. How does useReducer differ from useState?
6. What are custom hooks, and how do you create one?
---
3. Lifecycle Methods
1. What are the phases of a React component lifecycle?
2. What is the difference between componentDidMount and componentDidUpdate?
3. What is componentWillUnmount used for?
---
4. Virtual DOM
1. What is the Virtual DOM, and how does React use it?
2. How does React improve performance using the Virtual DOM?
---
5. Redux
1. What is Redux, and why is it used in React applications?
2. What are the core principles of Redux?
3. What is an action in Redux?
4. What is a reducer? How is it used in Redux?
5. What is the purpose of the store in Redux?
6. How is middleware used in Redux?
7. What is the difference between Redux and Context API?
---
6. Advanced React Concepts
1. What are React Portals, and why are they used?
2. Explain the concept of code splitting in React.
3. What is server-side rendering (SSR) in React?
4. What is React Context, and how is it different from Redux?
5. How do you optimize a React application?
---
7. React Router
1. What is React Router, and why is it used?
2. What are the differences between <Switch> and <Routes> in React Router v6?
3. How do you implement dynamic routing in React Router?
4. What is the difference between useHistory and useNavigate in React Router?
---
8. Miscellaneous
1. What are controlled and uncontrolled components in React?
2. What is Prop Drilling, and how can you avoid it?
3. What are the differences between React and Angular/Vue?
4. What is the purpose of React DevTools?
---
Practice Coding Questions
1. Create a counter app with React Hooks (useState, useEffect).
2. Implement a to-do list with Redux for state management.
3. Build a form with controlled components and validations.
4. Set up dynamic routes with React Router and load data on navigation.
5. Create a custom hook to fetch API data.