Skip to the page

DOM & browser APIs · Concept

Bubbling vs capturing, stopPropagation vs preventDefault

The interviewer asks

Explain the three event phases. Difference between stopPropagation, stopImmediatePropagation and preventDefault? What does { passive: true } do?

Then

Follow-ups the interviewer asks next

  1. Use cases for capture (outside-click detection, analytics).
  2. Why passive listeners matter for scroll performance.
  3. mouseenter vs mouseover.

The answer

What a strong answer covers

  • Capture (window → target), target, bubble (target → window)
  • preventDefault cancels the default action, not propagation
  • Passive listeners promise not to call preventDefault, so the browser can scroll without waiting

The red pen

Common traps

Avoid:mixing up preventDefault and stopPropagation.

Practise this out loud

Say your answer out loud to an AI interviewer that follows up, and get a score for it.

Practise by voice

Practise questions like this out loud

Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.

Start your free interview