Available question text
Wrap an existing iterator to add a peek() operation that returns the next element without advancing the iterator, while preserving correct behavior for next() and hasNext() across multiple calls. The challenge is to maintain the iterator state so peek() can be called repeatedly without consuming the element (and to generalize this design for any type).
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
Roku
Leetcode 284. Peeking Iterator
Reported May 8, 2026 · 1 source report
SENIOR
Source snapshot: Nov 12, 2026
View source