Loading

Quipoin Menu

Learn • Practice • Grow

Direction: Choose the correct option

Q1.

What is the purpose of the useMemo hook?
A. To create refs
B. To handle side effects
C. To memoize functions
D. To memoize expensive computations
Direction: Choose the correct option

Q2.

What does useMemo return?
A. A ref
B. A state variable
C. A memoized value
D. A memoized function
Direction: Choose the correct option

Q3.

When should you use useMemo?
A. For expensive calculations that you don't want to recompute on every render
B. For all functions
C. For every variable
D. For state updates
Direction: Choose the correct option

Q4.

What happens if the dependencies array is empty?
A. The value is computed only once
B. It throws an error
C. The value is computed on every render
D. The value never updates
Direction: Choose the correct option

Q5.

Given const computed = useMemo(() => expensive(a, b), [a, b]); When does expensive re-run?
A. Only when a or b change
B. On every render
C. Only when a changes
D. Only when b changes