Reported interview periodAug 2026
Independent Lazy Iterators
Implement a utility that turns one input iterable into n iterators. Every returned iterator must yield the full source sequence in order, and consumers may advance at different speeds. Read each source value on…
Practice focusRaise ValueError when n < 1 . Source exceptions and exhaustion should propagate consistently to every consumer. Concurrent calls are out of scope for the initial implementation. Start with a correct design, then improve its memory usage so that buffered values are shared rather than copied into n independent queues. Space should be proportional to the distance between the fastest and slowest consumers plus per-consumer cursor state. Staged follow-ups 1. Explain when buffered values can safely be discarded. 2.…