Tricky frontend questions

Published on
-
2 mins read
Authors
  • avatar
    Name
    Krishankant
    Twitter

Q: How would you optimise your React app performance ?

A: https://www.telerik.com/blogs/5-techniques-optimizing-performance-react-app

Q : What is the second argument that can optionally be passed to setState and what is its purpose?

A: https://www.geeksforgeeks.org/what-is-the-second-argument-that-can-optionally-be-passed-to-setstate-and-what-is-its-purpose/

Q: What are refs in React? When to use them?

A: https://reactjs.org/docs/hooks-reference.html#useref

Q: What is the use of arrow function in react ?

A: https://dev.to/sag1v/javascript-the-this-key-word-in-depth-4pkm

Q: What are Pure Components ?

A: https://medium.com/technofunnel/working-with-react-pure-components-166ded26ae48

Q: Explain the components of Redux

A :

  • Action — The action is the only source of information that sends data from our application to our store. Actions are sent the store using store.dispatch().
  • Reducer — Reducers specify how the app’s state changes in response to actions sent to the store. Since the actions don’t show the application’s state changes, this place determines how the state will change to an action.
  • Store — The Store is the object that brings Action and Reducer together. The store has the following responsibilities: Holds application state; Allows access to the state via getState(); Allows state to be updated via dispatch(action); Registers listeners via subscribe(listener); Handles unregistering of listeners via the function returned by subscribe (listener).

Q: What is Context?

A: https://www.freecodecamp.org/news/react-context-for-beginners/

Q: What are HOCs ( Higher Order Components ) in react ?

A: https://dev.to/codebucks/what-is-higher-order-component-hoc-in-react-2e1p