SpinTheMic
Pro

Interview practice question

JavaScript-driven layout causes stuttering

Frontend Engineering · HTML and CSS · Experienced

A feature that positions elements with JavaScript makes the page stutter during scrolling. Profiling shows "forced reflow" warnings. How do you fix it?

What a strong answer covers

Your AI report card counts how many of these ideas you cover.

  • Interleaved reads/writes force synchronous layout.
  • Batch reads then writes (requestAnimationFrame).
  • Use CSS solutions (sticky, grid, anchor positioning).
  • IntersectionObserver/ResizeObserver instead of scroll handlers.
  • Passive listeners, throttling.
Practise this topic

Start without signing up. Sign in free to get an AI report card on your answer.

See all topics