Top 101 React.js Interview Questions

Q1. What is React?


Q2. Why should we use React?


Q3. Main features of React?


Q4. What is useCallback?


Q5. What is useRef?


Q6. What is PureComponent?


Q7. What is Suspense?


Q8. What is HOC?


Q9. What about Component Lifecycle?


Q10. What is Test Renderer?


Q11. Alternative to componentDidMount, componentDidUpdate and componentWillUnmount in functional component?


Q12. Why is useState not named createState instead?


Q13. What should I do to Optimizing Performance by Skipping Effects, means useEffect?


Q14. What is HTML DOM createElement() Method?


Q15. Can you initialize state from a function? Provide an example?


Q16. Can we create component within component?


Q17. What do you understand by refs in React?


Q18. List some of the cases when you should use Refs?


Q19. What can you do with HOC?


Q20. What are the limitations of React?


Q21. Difference between Props vs. State in React?


Q22. What is the significance of keys in React?


Q23. What is Flux?


Q24. List down the components of Redux?


Q25. What is JSX?


Q26. Why can't browsers read JSX?


Q27. Why is switch keyword used in React Router v4?


Q28. What is Context API?


Q29. What is the second argument that can optionally be passed to setState and what is it's purpose?


Q30. What is context?


Q31. How different is React’s ES6 syntax when compared to ES5?


Q32. What is the difference between Shadow DOM and Virtual DOM?


Q33. What is reconciliation?


Q34. Difference between JSX and Babel?


Q35. What are fragments?


Q36. What are the lifecycle methods going to be deprecated in React v16?


Q37. Why should component names start with capital letter?


Q38. What is the virtual DOM?


Q39. Can you force a component to re-render without calling setState?


Q40. What is a state in React and how is it used?


Q41. What is the difference between super() and super(props) in React using ES6 classes?


Q42. What is the difference between React and ReactDOM?


Q43. How many parameter can take useEffect?


Q44. Can we update state directly?


Q45. What is arrow function in React? How is it used?


Q46. Why we define super in class?


Q47. What is the difference between ReactJS and React Native?


Q48. What is the difference between Real DOM and Virtual DOM?


Q49. Explain the purpose of render() in React


Q50. What is reducer in redux?


Q51. What is an event in React?


Q52. Differentiate between stateless and stateful components?


Q53. What are synthetic events in React?


Q54. What is Actions in redux?


Q55. What is the purpose of getSnapshotBeforeUpdate() lifecycle method?


Q56. What is the difference between controlled and uncontrolled components?


Q57. What are forms in React?


Q58. What are the different phases of React component’s lifecycle?


Q59. How do you write comments in React?


Q60. What is the difference between Element and Component?


Q61. Difference between local & session storage?


Q62. setState is an asynchronous or synchronous function?


Q63. Why are fragments better than container divs?


Q64. How to apply validation on props in React?


Q65. What are the differences between class and functional components?


Q66. What is prop drilling?


Q67. Is props read-only?


Q68. What is event bubbling and event capturing?


Q69. How to send data from view to action in redux?


Q70. What is Redux?


Q71. When to use Redux?


Q72. When not to choose Redux?


Q73. How can we get data from Store/Reducer in redux?


Q74. Explain the Lists in React.


Q75. How are forms created in React?


Q76. What is React Router?


Q77. How is React routing different from normal routing?


Q78. How do you modularize code in React?


Q79. What do you understand by "Single source of truth"?


Q80. What are the advantages of Redux?


Q81. How do you style React components?


Q82. What is create-react-app?


Q83. What are the differences between npm and npx?


Q84. When do we prefer to use a class component over a function component?


Q85. What are Forward Refs?


Q86. Which is the preferred option callback refs or findDOMNode()?


Q87. What is serviceWorker?


Q88. What are hooks in React?


Q89. What are the Rules of Hooks?


Q90. What is an error boundary or error boundaries?


Q91. In which cases do error boundaries not catch errors?


Q92. What were the major problems with MVC framework?


Q93. How to access the Redux store outside a component?


Q94. Why should we not update the state directly?


Q95. What are inline conditional expressions?


Q96. What is React Fiber?


Q97. How do you memoize a component?


Q98. How you implement Server Side Rendering or SSR?


Q99. Do Hooks replace render props and higher order components?


Q100. What is redux-saga?


Q101. What is React lazy function?