iterator
iterator is one of the most repeated interview dimensions. Start with edge-safe fundamentals, then move into pattern-level trade-offs.
Interview Signal
Frequently tests problem modeling, edge handling, and verbal clarity.
Common Pitfall
Template-only answers break under follow-up questioning.
Practice Strategy
Practice in 3-5 problem rounds and always review complexity alternatives.
Recommended Progression
Foundation
High-Pressure Round
Binary Search Tree Iterator
Implement an iterator for in-order traversal of a binary search tree (BST), maintaining traversal state with stack-based…
Peeking Iterator
Design an iterator with peek functionality, adding to the standard next and hasNext operations for efficient element acc…
Flatten Nested List Iterator
Implement an iterator to flatten a nested list of integers, accounting for potential nesting levels.
RLE Iterator
Design an efficient iterator for a run-length encoded array, handling large counts and sequential access correctly every…
Iterator for Combination
Implement an iterator that generates all combinations of a given length using efficient backtracking with pruning.