Reported interview periodJan 2026–Jul 2026
Snapshot Iterator over a Mutable Set
Implement an insertion-ordered mutable set whose iterators observe a stable snapshot even as the live set changes.
Practice focusRequirements - Iteration follows current insertion order at iterator creation time. - Adding an already-present value changes nothing. - Removing and later re-adding a value places it at the end of the live order. - contains reflects current state, while an existing iterator continues to return exactly its snapshot. - next raises StopIteration after exhaustion. - Removing an absent value is a no-op. has next never advances an iterator, including repeated checks after exhaustion. Independent iterators have independent cursors.…