Loading

Quipoin Menu

Learn • Practice • Grow

react / useMemo for Performance
mcq
Direction: Choose the correct option

Q1.

How does useMemo help with performance?
A. By memoizing expensive calculations so they don't run on every render
B. By caching API responses
C. By preventing re-renders
D. By memoizing components
Direction: Choose the correct option

Q2.

When should you use useMemo for performance?
A. For state updates
B. For expensive computations that are likely to be a bottleneck
C. For simple arithmetic
D. For all values
Direction: Choose the correct option

Q3.

What is the difference between useMemo and React.memo?
A. React.memo is for functions
B. useMemo is for class components
C. They are the same
D. useMemo memoizes values, React.memo memoizes components
Direction: Choose the correct option

Q4.

Given a list filter operation, when would you use useMemo?
A. Only when the list is small
B. Always
C. When filtering a large array to avoid re-filtering on every render
D. Never
Direction: Choose the correct option

Q5.

What happens if the dependencies of useMemo are not specified correctly?
A. It throws an error
B. It uses default values
C. It always recomputes
D. The memoized value may become stale or not update when needed