0% found this document useful (0 votes)
7 views

React_Interview_MCQ_Questions_with_Answers

This document contains a series of multiple-choice questions and answers related to React.js, covering fundamental concepts such as JSX, state management, hooks, and component lifecycle methods. Key topics include the Virtual DOM, props, Redux, and React Router. The document serves as a study guide for individuals preparing for React.js interviews.

Uploaded by

jitsarkar713146
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

React_Interview_MCQ_Questions_with_Answers

This document contains a series of multiple-choice questions and answers related to React.js, covering fundamental concepts such as JSX, state management, hooks, and component lifecycle methods. Key topics include the Virtual DOM, props, Redux, and React Router. The document serves as a study guide for individuals preparing for React.js interviews.

Uploaded by

jitsarkar713146
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

React.

js Interview MCQ Questions with Answers

1. What is React.js?

Answer: C) A JavaScript library

2. What is JSX in React?

Answer: B) JavaScript XML

3. What does `useState` hook do in React?

Answer: B) Adds state to functional components

4. What is the Virtual DOM in React?

Answer: A) A copy of the real DOM

5. Which method is used to update the state in a React class component?

Answer: A) this.setState()

6. What is `props` in React?

Answer: A) Data passed from parent to child components

7. What is the purpose of `useEffect` in React?

Answer: B) To handle side effects like fetching data

8. What is Redux used for?

Answer: A) State management

9. How can you prevent a component from re-rendering in React?

Answer: D) All of the above

10. What is React Router used for?

Answer: B) For navigation between pages in a React app


11. What is the purpose of `key` prop in React lists?

Answer: A) To uniquely identify each element

12. What is a class component in React?

Answer: A) A component that extends React.Component

13. What is the default state of a React component?

Answer: B) undefined

14. What is the purpose of the `render` method in a React component?

Answer: A) To return JSX

15. How do you handle events in React?

Answer: D) All of the above

16. What is React Context used for?

Answer: A) To pass data without props drilling

17. What is React Fragment?

Answer: A) A component that returns multiple elements without extra nodes

18. What is `componentDidMount` in React?

Answer: A) A lifecycle method that runs after the component is rendered

19. What is the purpose of `React.memo`?

Answer: B) To memoize components and prevent unnecessary re-renders

20. What does the `useReducer` hook do?

Answer: B) Manages complex state logic in functional components

You might also like