0% found this document useful (0 votes)
4 views3 pages

React Interview Questions

react interview question generally asked in interview

Uploaded by

rawatushar38
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

React Interview Questions

react interview question generally asked in interview

Uploaded by

rawatushar38
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

1.

React Basics
- What is React?
- What are the features of React?
- What is JSX?
- What is the virtual DOM?
- How does React render components?
- What is the difference between real DOM and virtual DOM?
- What is the use of `key` in React lists?
- What is the difference between a class component and a functional component?

2. Component Lifecycle
- What are the lifecycle methods of a class component?
- What is `componentDidMount()` used for?
- What is the equivalent of lifecycle methods in functional components?
- What is unmounting in React?
- What is cleanup in `useEffect`?

3. React Hooks
- What are Hooks?
- Why were Hooks introduced?
- Explain `useState`, `useEffect`, `useRef`, `useMemo`, and `useCallback`.
- What is the difference between `useEffect` and `useLayoutEffect`?
- Can you explain the rules of hooks?
- When to use `useReducer` instead of `useState`?

4. State and Props


- What is the difference between state and props?
- Can props be modified?
- What happens when state is updated?
- How is data passed from parent to child and child to parent?

5. Event Handling & Forms


- How do you handle events in React?
- How do you handle forms in React?
- How to create controlled vs uncontrolled components?
- What is the difference between `onChange` and `onInput`?

6. Conditional Rendering
- How do you implement conditional rendering?
- Difference between ternary operator and `&&` rendering?

7. List Rendering
- How do you render lists in React?
- Why is `key` important in a list?
- What happens if keys are not unique?
8. Code-Based Questions
- Write a React component to display a counter.
- Create a Todo App in React using hooks.
- Show an example of conditional rendering.
- Implement a dropdown using React.
- Write a component with a button that toggles theme (light/dark).

9. Performance Optimization
- What is [Link]?
- What is lazy loading in React?
- What is code-splitting?
- How does `useMemo` help in performance?
- What is the difference between `useMemo` and `useCallback`?

10. Routing (React Router)


- What is React Router?
- How do you implement routing in React?
- What is the difference between `BrowserRouter` and `HashRouter`?
- How to redirect a user programmatically?

11. Context and State Management


- What is React Context?
- How to use `useContext`?
- What is Redux? How is it different from Context API?
- What are actions, reducers, and store in Redux?

12. Advanced Topics


- What is server-side rendering (SSR) in React?
- What is hydration in React?
- What is reconciliation?
- Explain React Fiber.
- What are higher-order components (HOC)?
- What are render props?

13. Best Practices


- Folder structure for large React apps?
- When to use `useEffect`?
- When to use controlled components?
- How to avoid prop drilling?

14. React + Other Tech


- How do you integrate React with REST API?
- How to fetch data using `fetch` or `axios`?
- How do you handle errors in React?
- How do you show a loading spinner while fetching data?
15. Tricky & Conceptual
- Why can’t we update state directly like `[Link] = 5`?
- Why keys are not used as array index?
- What is the difference between `[Link]` and `div`?
- Can we have multiple return statements in a component?
- Difference between `[Link]()` and JSX?

You might also like