100% found this document useful (1 vote)
392 views

React JS Multiple Choice Interview Questions (MCQ) - Test Your React JS Knowledge

The document contains 30 multiple choice questions about React JS concepts like what React JS is, what it covers, how it increases performance using the virtual DOM, its component-based nature, controlled and uncontrolled components, state management using setState, and other core React concepts. It also provides the answers to each question.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
392 views

React JS Multiple Choice Interview Questions (MCQ) - Test Your React JS Knowledge

The document contains 30 multiple choice questions about React JS concepts like what React JS is, what it covers, how it increases performance using the virtual DOM, its component-based nature, controlled and uncontrolled components, state management using setState, and other core React concepts. It also provides the answers to each question.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

By InterviewMocks.

com
React JS Multiple choice interview questions (MCQ) - Test your
React JS knowledge

Q1. What is React Js?

A. Javascript framework
B. Javascript library
C. Javascript file
D. None of the Above

Q2. What does ReactJS cover?

A. Data layer in an application


B. User Interface layer in an application
C. Both A & B
D. All are Correct

Q3. What does ReactJS use to increase performance?

A. Virtual DOM
B. Original DOM
C. Local DOM
D. None of the Above

Q4. React is ............ Javascript library

A. Module based
B. Component based
C. System based
D. All are Correct

Q5. A valid react component can return ...... number of elements.

A. 1
B. 2
C. 3
D. None of the Above
Q6. For controlled components in react

A. Source of truth is DOM


B. Source of truth is component state
C. Source of truth can be anything
D. None of above

Q7. For uncontrolled components in react

A. Source of truth is DOM


B. Source of truth is component state
C. Source of truth can be anything
D. None of above

Q8. Number of elements, a valid react component can return

A. 1
B. 2
C. 3
D. 5

Q9. React is a ________

A. Javascript library
B. Javascript framework
C. Both of above
D. None of above

Q10. Which of the following API is a MUST for every ReactJS component?

A. getInitialState
B. render
C. renderComponent
D. None

Q11. How can you access the state of a component from inside of a member function?

A. this.getState()
B. this.state
C. this.prototype.stateValue
D. this.values
Q12. What is a good use case for using a function while rendering a dynamic list of
items

A. If we need to compute a value based on properties of items in the loop.


B. None. Functions should not be used while rendering a dynamic list.
C. To make the code shorter

Q13. What is the second argument for setState useful for?

A. To invoke code after the setState operation is done


B. To replace the state completely instead of the default merge action
C. To access the previous state before the setState operation

Q14. ReactJS uses _____ to increase performance

A. Virtual DOM
B. Original DOM
C. Both of above
D. None of above

Q15. What is the default port for webpack dev server?

A. 3000
B. 8080
C. 3306
D. 8809

Q16. What are two ways data gets handled in react?

A. state & props


B. services & components
C. state & services
D. state & component

Q17. React Js is developed by

A. Google
B. Microsoft
C. Facebook
D. None of above
Q18. What are the limitations of ReactJS?

A. React is only for view layer of the app so we still need the help of other technologies to get a
complete tooling set for development
B. React is using inline templating and JSX. This can seem awkward to some developers
C. The library of react is too large
D. All of these

Q19. How many stages are there in React js life cycle

A. 1
B. 2
C. 3
D. 0

Q20. In relation to React js component lifecycle, which statement is true

A. only function component can have life cycle


B. Only class components can have life cycle
C. Both type of components can have life cycle
D. None of above

Q21. In react, this is used to pass data to component from outside?

A. set state
B. render with argument
C. props
D. propTypes

Q22. Ref in react component is used to assign reference to DOM elements. Ref can be
created by

A. Calling React.createRef method


B. Assigning a value to ref attribute in JSX
C. Both of above
D. None of above

Q23. Everything in react is __________

A. module
B. component
C. package
D. class

Q24. How many elements does a react component returns?

A. 1
B. 0
C. Multiple elements with one root element
D. None of the above

Q25. Which of the following is a correct definition of state in react?

A. A persistent storage
B. An internal data store (object) of component
C. Both
D. None

Q26. The state in react can be updated by call to setState method. These calls are

A. Synchronous in nature
B. Asynchronous in nature
C. Are asynchronous but can be made synchronous when required
D. None of above

Q27. Keys are given to a list of elements in react. These keys should be

A. Unique in the DOM


B. Unique among the siblings only
C. Do not requires to be unique
D. None of above

Q28. Regarding React js components, which of following statement is true?

A. function components can have state


B. function components are light weight
C. class components are light weight
D. class components are faster than function component

Q29. To update state in react forcefully, which method is used

A. setState
B. forceUpdate
C. Both of above
D. None of above

Q30. What will happen if you render an input element with disabled = {false}

A. It will be rendered as enabled


B. It will be rendered as disabled
C. It will not be rendered at all

Please Visit interviewmocks.com to download more pdfs

You might also like