Iterators interview questions
Practice 4 questions on iterators. Each runs in a real in-browser editor with Jest tests and a worked, diagram-backed solution.
4 questions
- JavaScriptCoding exercise
Cycle
EASYImplement a function that, given several values, returns a function that yields each one in turn and loops forever.
15 minUberPractice - JavaScriptCoding exercise
Array.fromAsync
MEDIUMImplement Array.fromAsync: build a promise of an array from a sync or async iterable, awaiting each value in order.
30 minPremium questionPractice - JavaScriptCoding exercise
Iterator Helpers
MEDIUMBuild lazy, chainable iterator helpers — map, filter, take, drop, and flatMap — that pull one value at a time.
35 minPremium questionPractice - JavaScriptCoding exercise
String replaceAll / matchAll
MEDIUMImplement replaceAll and matchAll — replace every occurrence of a substring or global pattern, and iterate every match with its capture groups.
35 minPremium questionPractice