Implement a Lazy Union Iterator Over Two Strictly Sorted Iterators
Company: MongoDB
Role: Software Engineer
Category: Software Engineering Fundamentals
Difficulty: medium
Interview Round: Technical Screen
Overview: Implement a UnionIterator that lazily merges two strictly sorted iterators of integers or strings into one strictly sorted iterator without duplicates, using constant extra memory. Tests iterator protocol design, one-element lookahead, cross-input deduplication, end-of-stream behavior and edge cases such as empty inputs.
Read the full MongoDB Software Engineer interview experience this question came from