Reported interview periodApr 2026
Resumable Iterators
Implement an iterator over a copied list that can serialize its position and later resume at the next not-yet-yielded item. Then compose the same behavior across a sequence of lists.
Practice focusSaved state points to the next item, never the last item returned. A completed iterator restores completed. State must be serializable and restoration must not repeat or skip values. The chain state records both the current group and the position within it. Use exactly {"index": integer} for list state and {"outer": integer, "inner": {"index": integer}} for chain state. Reject malformed keys, booleans/nonintegers and negative or out-of-range active indices with ValueError .…