Design a Lazy Union Iterator for Sorted Inputs
Company: MongoDB
Role: Software Engineer
Category: Software Engineering Fundamentals
Difficulty: medium
Interview Round: Technical Screen
Overview: Design a lazy iterator that merges two sorted integer streams while preserving duplicates and left-first ordering on ties. Ensure repeated availability checks do not consume output, keep buffering bounded, and generalize the contract to any number of sorted iterators.