State & Effect Hooks interview questions

18 real State & Effect Hooks questions from the React bank, as asked in Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd — free to start.

1. What is useState?

Junior
  1. A.the function returned from useEffect, run before the next effect and on unmount
  2. B.a hook returning a stateful value and a setter that triggers a re-render when called
  3. C.hooks must be called at the top level in the same order every render, only from React functions
  4. D.useEffect's second argument controlling when it re-runs; an empty [] runs it once after mount
Reveal the answer + AI explanation — free account

3. Which statement is correct?

Junior
  1. A.useState — hooks must be called at the top level in the same order every render, only from React functions
  2. B.useState — a hook returning a stateful value and a setter that triggers a re-render when called
  3. C.useState — like useEffect but fires synchronously after DOM mutations and before the browser paints
  4. D.useState — the function returned from useEffect, run before the next effect and on unmount
Reveal the answer + AI explanation — free account

4. What is useEffect?

Junior
  1. A.like useEffect but fires synchronously after DOM mutations and before the browser paints
  2. B.a hook returning a stateful value and a setter that triggers a re-render when called
  3. C.hooks must be called at the top level in the same order every render, only from React functions
  4. D.a hook that runs side effects after render and re-runs when its dependency array changes
Reveal the answer + AI explanation — free account

6. Which statement is correct?

Junior
  1. A.useEffect — useEffect's second argument controlling when it re-runs; an empty [] runs it once after mount
  2. B.useEffect — like useEffect but fires synchronously after DOM mutations and before the browser paints
  3. C.useEffect — a hook returning a stateful value and a setter that triggers a re-render when called
  4. D.useEffect — a hook that runs side effects after render and re-runs when its dependency array changes
Reveal the answer + AI explanation — free account

7. What is Effect cleanup?

Mid
  1. A.a hook that runs side effects after render and re-runs when its dependency array changes
  2. B.a hook returning a stateful value and a setter that triggers a re-render when called
  3. C.like useEffect but fires synchronously after DOM mutations and before the browser paints
  4. D.the function returned from useEffect, run before the next effect and on unmount
Reveal the answer + AI explanation — free account

9. Which statement is correct?

Mid
  1. A.Effect cleanup — useEffect's second argument controlling when it re-runs; an empty [] runs it once after mount
  2. B.Effect cleanup — a hook returning a stateful value and a setter that triggers a re-render when called
  3. C.Effect cleanup — the function returned from useEffect, run before the next effect and on unmount
  4. D.Effect cleanup — hooks must be called at the top level in the same order every render, only from React functions
Reveal the answer + AI explanation — free account

10. What is Dependency array?

Junior
  1. A.hooks must be called at the top level in the same order every render, only from React functions
  2. B.like useEffect but fires synchronously after DOM mutations and before the browser paints
  3. C.a hook returning a stateful value and a setter that triggers a re-render when called
  4. D.useEffect's second argument controlling when it re-runs; an empty [] runs it once after mount
Reveal the answer + AI explanation — free account

12. Which statement is correct?

Junior
  1. A.Dependency array — useEffect's second argument controlling when it re-runs; an empty [] runs it once after mount
  2. B.Dependency array — the function returned from useEffect, run before the next effect and on unmount
  3. C.Dependency array — hooks must be called at the top level in the same order every render, only from React functions
  4. D.Dependency array — a hook returning a stateful value and a setter that triggers a re-render when called
Reveal the answer + AI explanation — free account

13. What is Rules of Hooks?

Mid
  1. A.hooks must be called at the top level in the same order every render, only from React functions
  2. B.a hook returning a stateful value and a setter that triggers a re-render when called
  3. C.the function returned from useEffect, run before the next effect and on unmount
  4. D.useEffect's second argument controlling when it re-runs; an empty [] runs it once after mount
Reveal the answer + AI explanation — free account

15. Which statement is correct?

Mid
  1. A.Rules of Hooks — the function returned from useEffect, run before the next effect and on unmount
  2. B.Rules of Hooks — hooks must be called at the top level in the same order every render, only from React functions
  3. C.Rules of Hooks — like useEffect but fires synchronously after DOM mutations and before the browser paints
  4. D.Rules of Hooks — a hook that runs side effects after render and re-runs when its dependency array changes
Reveal the answer + AI explanation — free account

16. What is useLayoutEffect?

Senior
  1. A.like useEffect but fires synchronously after DOM mutations and before the browser paints
  2. B.a hook that runs side effects after render and re-runs when its dependency array changes
  3. C.the function returned from useEffect, run before the next effect and on unmount
  4. D.useEffect's second argument controlling when it re-runs; an empty [] runs it once after mount
Reveal the answer + AI explanation — free account

18. Which statement is correct?

Senior
  1. A.useLayoutEffect — useEffect's second argument controlling when it re-runs; an empty [] runs it once after mount
  2. B.useLayoutEffect — like useEffect but fires synchronously after DOM mutations and before the browser paints
  3. C.useLayoutEffect — a hook that runs side effects after render and re-runs when its dependency array changes
  4. D.useLayoutEffect — the function returned from useEffect, run before the next effect and on unmount
Reveal the answer + AI explanation — free account

Free to start

Answers, AI explanations, and a scored voice mock interview

Sign up free to check your answers with explanations, ask the AI tutor anything on any question, and take one full AI mock interview — scored like a real panel.

Practice State & Effect Hooks free