Reported interview periodNov 2025–Aug 2026
Iterator that can pause and resume
Implement ResumableListIterator, an iterator that can save and restore its progress.
Practice focusget state() must return a JSON-serializable value that fully identifies the next item to produce. set state(state) must restore that position so iteration continues without repeating or skipping values. The iterator should use constant additional memory and follow normal Python iterator behavior at end of input. Handle empty and single-item lists, restoration at the beginning and end, invalid state, and repeated save/restore cycles. Follow-ups 1. Extend the design to a nested iterator. 2. Detect restoration against a changed underlying collection. 3.…