learn kro favicon img

Top 130 React Interview Questions 2023

Q1: How does React work?  

Q2: What is React?  

Q3: How would you write an inline style in React?  

Q4: What is the use of refs?  

Q5: What are props in React?  

Q6: What are the advantages of ReactJS?  

Q7: What are the major features of ReactJS?  

Q8: What is Context API in ReactJS?  

Q9: What are React Hooks?  Related To: React Hooks

Q10: What are refs used for in React?  

Q11: What are the differences between a Class component and Functional component?  

Q12: What are the advantages of using React?  

Q13: What is the difference between a Presentational component and a Container component?  

Q14: What is the difference between state and props?  

Q15: What happens when you call setState?  

Q16: When rendering a list what is a key and what is it’s purpose?  

Q17: What happens during the lifecycle of a React component?  

Q18: How is React different from AngularJS (1.x)?  

Q19: What does it mean for a component to be mounted in React?  

Q20: What’s the difference between a Controlled component and an Uncontrolled one in React?  

Q21: What is Reconciliation in ReactJS?  

Q22: What is the difference between Component and Container in Redux?  Related To: Redux

Q23: What is the difference between Element and Component in ReactJS?  

Q24: What is the difference between state and props?  

Q25: What are inline conditional expressions in ReactJS?  

Q26: What are Controlled components in ReactJS?  

Q27: What are Fragments in React?  

Q28: What is the purpose of using super constructor with props argument in React?  

Q29: What are Stateless components in React?  

Q30: What are the limitations of React?  

Q31: What is state in React?  

Q32: What are two types of components in ReactJS?  

Q33: What is the purpose of callback function as an argument of setState?  

Q34: How to create refs in React?  

Q35: What are portals in React and when do we need them?  

Q36: What are Higher-Order Components (HOC) in React?  

Q37: What is JSX?  

Q38: What are Stateful components in React?  

Q39: What are advantages of using React Hooks?  Related To: React Hooks

Q40: What is useState() in React?  Related To: React Hooks

Q41: How to call loading function with React useEffect only once?  Related To: React Hooks

Q42: How to access DOM elements in React?  Related To: React Hooks

Q43: How would you prevent a component from rendering in React?  

Q44: What is {this.props.children} and when you should use it?  

Q45: Name the different lifecycle methods for a class components  

Q46: What are Stateless components in React?  

Q47: What is the difference between createElement and cloneElement?  

Q48: Are you familiar with Flux in the context of React?  

Q49: What is the significance of keys in ReactJS?  

Q50: What’s the typical pattern for rendering a list of components from an array in React?  

Q51: What does shouldComponentUpdate do and why is it important?  

Q52: What’s the typical flow of data like in a React + Redux app?  

Q53: What’s the difference between an Element and a Component in React?  

Q54: What are some limitations of things you shouldn’t do in the component’s render method in React?  

Q55: What is the point of shouldComponentUpdate() method?  

Q56: What are Pure Components?  

Q57: What is the difference between HTML and React event handling?  

Q58: How to bind methods or event handlers in JSX callbacks?  

Q59: What is Lifting State Up in ReactJS?  

Q60: What are the lifecycle methods of ReactJS class components?  

Q61: What are the different phases of ReactJS component lifecycle?  

Q62: What are Error Boundaries in ReactJS?  

Q63: Why we should not update state directly?  

Q64: What are forward refs?  

Q65: What is children prop?  

Q66: What would be the common mistake of function being called every time the component renders?  

Q67: What is the difference between ShadowDOM and VirtualDOM?  

Q68: What are Uncontrolled components?  

Q69: What is Key and benefit of using it in lists?  

Q70: Why React uses className over class attribute?  

Q71: What is prop drilling and how can you avoid it?  

Q72: What’s the difference between useRef and createRef?  

Q73: What is StrictMode in React?  

Q74: Why do class methods need to be bound to a class instance?  

Q75: What do these three dots (…) in React do?  

Q76: What’s wrong with using Context in React?  

Q77: What is Components Composition in React?  

Q78: What does Batching mean in ReactJS?  Related To: React Hooks

Q79: What are the advantages of Batching in ReactJS?  Related To: React Hooks

Q80: Which lifecycle methods of class component is replaced by useEffect in functional component?  Related To: React Hooks

Q81: Compare useState and useReducer implementations  Related To: React Hooks

Q82: Do React Hooks cover all use cases for class components?  Related To: React Hooks

Q83: How can I make use of Error Boundaries in functional React components?  Related To: React Hooks

Q84: When would you use useRef?  Related To: React Hooks

Q85: How would you pass data from child to parent component in React?  

Q86: What is the purpose of super(props)?  

Q87: Explain the Virtual DOM concept in React  

Q88: Describe Flux vs MVC?  Related To: ASP.NET MVC

Q89: Why doesn’t this.props.children.map work?  

Q90: Can you force a React component to rerender without calling setState?  

Q91: Describe how events are handled in React  

Q92: What’s a Pure Functional Component in React?  

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

Q94: Why would you need to bind event handlers to this?  

Q95: Why does React use SyntheticEvents?  

Q96: How to apply validation on props in ReactJS?  

Q97: How to create Props Proxy for HOC component?  

Q98: What is the difference between using constructor vs getInitialState in React?  

Q99: When is it important to pass props to super(), and why?  

Q100: How to conditionally add attributes to React components?  

Q101: When would you use StrictMode component in React?  

Q102: How would you go about investigating slow React application rendering?  

Q103: Does React re-render all components and sub components every time setState is called?  

Q104: What’s the difference between useCallback and useMemo in practice?  Related To: React Hooks

Q105: Explain why and when would you use useMemo()?  Related To: React Hooks

Q106: When to use useCallback, useMemo and useEffect?  Related To: React Hooks

Q107: Can you do Components Inheritance in React?  

Q108: What is difference between Incremental DOM and Virtual DOM?  Related To: Angular

Q109: When would you use flushSync in ReactJS?  Related To: React Hooks

Q110: When shall we use useReducer hook in ReactJS?  Related To: React Hooks

Q111: When to use useState vs useReducer?  Related To: React Hooks

Q112: How would you store non-state/instance variables in functional React components?  Related To: React Hooks

Q113: What is a Pure Function?  

Q114: What is React Fiber?  

Q115: Explain some difference between Flux and AngularJS (1.x) approach  

Q116: How to avoid the need for binding in React?  

Q117: What is the key architectural difference between a JavaScript library such as React and a JavaScript framework such as Angular?  

Q118: How does React renderer work exactly when we call setState?  

Q119: How to use React.memo()?  

Q120: Can a custom React hook return JSX?  Related To: React Hooks

Q121: What is the order of useInsertionEffect, useEffect and useLayoutEffect hooks at component generation ?  

Code Challenges

Q1: Provide an example of any simple Custom React Hook. Why do we need Custom Hooks?  Related To: React Hooks

Q2: What is equivalent of the following using React.createElement?  

Q3: Given the React code defined above, can you identify two problems?  

Q4: What is equivalent of this code using React Hooks?  Related To: React Hooks

Q5: What’s wrong with that code?  

Q6: If you created a React element like Twitter below, what would the component definition of Twitter look like?  

Q7: What is wrong with this code?  

Q8: How to mitigate multiple component re-renders when using multiple useState calls?  Related To: React Hooks

Q9: How would you optimise this code using one of the React Hooks?  Related To: React Hooks

Leave a Comment

Your email address will not be published. Required fields are marked *