The Meta Frontend Loop Questions (2024)

Four utility-belt questions from a frontend loop at a large social platform in early 2024. They look like trivia but each one is graded on a specific edge case. Mine got me to round three.

Question Bundle
JavaScript
interview-prep
frontend
meta
davidmorgan

By @davidmorgan

December 16, 2025

·

Updated August 9, 2026

1,173 views

23

4.5 (10)

Implement a debounce(fn, wait) utility. Calling the returned function repeatedly should only invoke fn once, wait ms after the last call. Bonus: support cancel().

On the whiteboard

On the whiteboard I'd write:

JavaScript
const d = debounce(save, 300);
d('a'); d('ab'); d('abc'); // three calls inside 300ms
// 300ms after the last call: save('abc') fires once with the trailing args
d.cancel(); // before the timer fires, drops the queued invocation

3 more questions and all solutions are locked.

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