Interview Q&A · questions with model answers

React Developer Interview Questions

Part of the study plan for: Frontend Engineer · Full Stack Engineer

Ordered by how often they're asked. Most-asked answers are free to read in full; members see every answer and can rate their confidence on each.

  1. Most asked Explain React concept: controlled vs uncontrolled inputs.

    A controlled input gets its value from React state, while an uncontrolled input stores its current value in the DOM.

  2. Most asked What does `useState` do and when should you use it?

    useState stores local component state and provides a setter that schedules re-rendering when the value changes.

  3. Most asked What does `useEffect` do and when should you use it?

    useEffect synchronizes a component with external systems after React commits a render.

  4. Most asked What does `useContext` do and when should you use it?

    useContext reads the current value from a React context provider above the component.

  5. Most asked What does `useRef` do and when should you use it?

    useRef holds a mutable value that persists across renders without causing re-renders when it changes.

  6. Most asked What does `custom hooks` do and when should you use it?

    Custom hooks extract reusable stateful logic into functions that call React hooks.

  7. Most asked What does `rules of hooks` do and when should you use it?

    The Rules of Hooks require hooks to be called at the top level of React components or custom hooks, in the same order every render.

  8. Most asked What does `useMemo` do and when should you use it?

    useMemo caches the result of a pure calculation between renders while its dependencies stay the same.

  9. Most asked What does `useCallback` do and when should you use it?

    useCallback caches a function identity between renders while its dependencies stay the same.

  10. Most asked When do you NOT need `useEffect`?

    You don't need effects to derive data from props/state (compute during render), to handle user events (do it in event handlers), to reset state on prop change (use key), to chain state updates, or…

  11. What does `effect dependency mistakes` do and when should you use it?

    Effect dependency mistakes happen when the dependency array does not match the reactive values used by the effect.

  12. What does `cleanup in effects` do and when should you use it?

    Effect cleanup tears down subscriptions, timers, pending work, or imperative resources before an effect re-runs or a component unmounts.

  13. Explain React concept: React elements vs components.

    A React element is a plain object description of UI; a component is a function or class that returns elements.

  14. Explain React concept: composition vs inheritance.

    React favors composition: building UI by nesting and configuring components instead of inheriting behavior through class hierarchies.

  15. What does `useReducer` do and when should you use it?

    useReducer manages state transitions with a reducer function and dispatch actions.

  16. What does `useTransition` do and when should you use it?

    useTransition marks state updates as non-urgent so React can keep urgent interactions responsive while rendering heavier updates.

  17. Discuss Redux vs Context in React applications.

    Context passes values through the tree; Redux is an external state container with predictable updates, tooling, middleware, and selector patterns.

  18. Which accessibility practices matter most in React apps?

    Use semantic HTML elements (button, nav, label), associate labels with inputs, manage focus on route changes and dialogs, ensure keyboard operability, provide text alternatives, respect color…

  19. What does `useLayoutEffect` do and when should you use it?

    useLayoutEffect runs synchronously after DOM mutations but before the browser paints.

  20. What does `useId` do and when should you use it?

    useId generates stable unique IDs that are consistent across server and client rendering.

  21. What does `useDeferredValue` do and when should you use it?

    useDeferredValue lets React lag a derived value behind an urgent value so expensive consumers can update later.

  22. How do render props and higher-order components compare with custom hooks?

    Render props (passing a function child) and HOCs (functions wrapping components) were earlier ways to share stateful logic. Custom hooks now cover most cases more simply, without wrapper nesting…

  23. When would you use `useImperativeHandle`?

    When a parent needs a limited imperative API from a child (e.g., focus(), scrollToItem(), play()), useImperativeHandle(ref, () => ({ ... })) exposes only those methods instead of the raw DOM node.

  24. What is the difference between state and props in React?

    Props are immutable inputs passed from parent to child components; state is local to a component and can change over time.

Was this page helpful?

Report a mistake