Skip to main content

JavaScript Frameworks

React Interview Questions and Answers

Review React interview questions on component design, state, effects, rendering, hooks, accessibility, testing, and performance.

  1. 01

    What causes a React component to render again?

    A component renders when its state changes, its parent renders, or consumed context changes. React may skip committed DOM changes when output is equivalent, but render functions should still remain pure.

  2. 02

    When should state be lifted up?

    Lift state to the nearest common owner when multiple components need the same source of truth or coordinated updates. Avoid moving state higher than necessary because broad ownership increases coupling and render scope.

  3. 03
    Latest question

    What is useEffect intended for?

    Question codetsx
    function Profile({ firstName, lastName }) {
      const [fullName, setFullName] = useState('')
    
      useEffect(() => {
        setFullName(`${firstName} ${lastName}`)
      }, [firstName, lastName])
    }

    useEffect synchronizes a component with an external system such as a subscription, timer, browser API, or network lifecycle. It should not be the default place for values that can be calculated during rendering.

    Answer codetsx
    function Profile({ firstName, lastName }) {
      const fullName = `${firstName} ${lastName}`
    
      return <h2>{fullName}</h2>
    }
  4. 04

    Why are stable keys important when rendering lists?

    Keys let React preserve the identity of items between renders. Unstable keys can cause incorrect state reuse, lost input state, or unnecessary component replacement when items are inserted or reordered.

  5. 05

    How should React performance problems be approached?

    Use the React Profiler and browser tools to find expensive renders or interactions first. Then narrow state, reduce unnecessary work, virtualize large collections, or memoize only where measurement shows value.

  6. 06

    What makes a reusable React component accessible?

    Start with semantic HTML, preserve keyboard behavior and focus, expose names and states to assistive technology, and test real interactions. ARIA supplements missing semantics but should not replace native elements.

Continue preparing

Related interview guides

Need delivery capability?

Pair technical understanding with the right specialist.

Hire React talent
Have a quick question?Chat on WhatsAppReact Interview Questions and Answers | Quinoid