The Frontend-Only Loop I Coach People Through

Five rounds I rehearse with frontend candidates: a DOM puzzle, a CSS layout, a state management drill, an accessibility audit, and a rendering performance question. JavaScript throughout, framework-agnostic where possible.

Question Bundle
JavaScript
frontend
interview-prep
react
css-flexbox
diyaandersen

By @diyaandersen

February 28, 2026

·

Updated August 12, 2026

979 views

5

4.3 (15)

Implement an event delegation helper that attaches a single click listener to a parent and dispatches to a per-selector handler. The interviewer follows up: how does this behave with stopPropagation called inside one of the handlers, and how does it differ from per-element listeners on memory?

Run it

JavaScript
const cleanup = delegate(list, 'li.item', (e, item) => console.log('clicked', item.dataset.id));
// One listener on `list`; clicking any li.item logs its data-id.
// 1,000 list items still cost one closure instead of 1,000.

cleanup(); // removes the listener; necessary on unmount to avoid leaks.
// Note: focus/blur do not bubble; use focusin/focusout or capture: true.

4 more questions and all solutions are locked.

Purchase this item to access all questions, code snippets, and solutions.