Friday, July 6, 2018

React JS Quiz - React JS Interview Questions.

Today we are going to provide basic react js interview question with answer, This quiz series helps to build more understanding on reactjs and java script library for building user interfaces.



1. We can go for keys when there is possibility that our user could change the data.
  • Keys
  • ref
  • both
  • none of above

2. JSX is typesafe.
  • True
  • False

3. React merges the object you provide into the current state using __________.
  • setState()
  • State()

4. Arbitrary inputs of components are called __________.
  • Keys
  • Props
  • Elements
  • Ref

5. _________ can be done while more than one element needs to be returned from a component.
  • Abstraction
  • Packing
  • Insulation
  • Wrapping


6. Which of the following needs to be updated to achieve dynamic UI updates?
  • State
  • Props

7. Lifecycle methods are mainly used ___________.
  • To keep track of event history
  • to enhance components
  • freeup resources
  • none of the options

8. State can be initialized when code is loaded or state can be set on event changes.
  • False
  • True


9. ref is used to refer a element / component returned by _______________.
  • react()
  • render()
  • reduce()
  • refer()


10. In JSX most of the errors can be caught during _________.
  • Interpretation
  • Execution
  • Compilation
  • Build


11. Components cannot refer to other components in their output.
  • True
  • False


12. JSX is faster because it performs ____________ while compiling code to JavaScript
  • Modification
  • Compression
  • Optimization
  • Encryption


13. If our elements are dynamic, react can keep track of the changes using keys.
  • True
  • False


14. Function that does not change its results for the same set of inputs are called __________.
  • Pure functions
  • Impure Functions


15. What is the smallest building block of ReactJS?
  • none of the options
  • props
  • elements
  • components


16. An altered component may be uniquely identified with the help of ref.
  • True
  • False


17. React considers everything as _______.
  • User interface
  • elements
  • components
  • Objects


18. React keeps track of what items have changed, been added, or been removed from a list using ________.
  • state
  • props
  • keys
  • ref


19. React is mainly for building _____________.
  • Database
  • Connectivity
  • User interface
  • Design platform


20. React supports all the syntax of _________________.
  • ES6
  • Redux
  • None of options
  • Native Java


21. In React state can be accessed using ________.
  • current
  • state
  • current()
  • state()


22. How can we prevent default behavior in React?
  • None of the options
  • using revokeDefault()
  • Using preventDefault()
  • using avoidDefault()


23. Invoked once, only on the client, after rendering occurs.
  • componentWillUnmount
  • shouldComponentUpdate
  • componentWillMount
  • componentDidMount


NOTE : we have marked answer in blue color.

Let us know your comment below in comment box.

Some More Important Topics To Learn :-

2 comments:

  1. I don't think this answer or question is correct "Lifecycle methods are mainly used freeup resources" because from React docs is talking about componentWillUnmount() not on every lifecycle

    ReplyDelete