Available question text
Run a generator that yields promises and return [cancel, promise] where each yielded promise's resolution or rejection is passed back into the generator via next/throw, and calling cancel() injects the string "Cancelled" as a thrown error to stop further execution. The returned promise should resolve with the generator's final value (or with the next yielded/returned value if a thrown error was caught) or reject with any uncaught error.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 2650. Design Cancellable Function
Interview date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source