All jobs / Frontend / web developer

Frontend / web developer interview question · 1–3 years

When is useMemo worth it?

The strongest answer

When a computation is measurably expensive and its inputs change rarely, or when a stable reference is needed for a dependency or a memoised child; memoising cheap values costs more than it saves

Why it works

Right. Measure, then memoise the expensive and the reference-sensitive.

What a good answer covers

Answers that fall short

Who gets asked this

More Frontend / web developer questions