Coinbase·Software Engineer·Technical Phone Screen
- Design and implement a full iterator library supporting range(start, end, step) with forward and backward traversal, inclusive and exclusive endpoints, negative steps, and overflow-safe termination. Include lazy combinators (map, filter, zip, take, drop, chain) each using O(1) space, a PeekableIterator with peek() and hasNext(), and discuss whether reset()/rewind() is feasible without materializing the sequence. Also define iterator invalidation rules when the underlying collection mutates, and write unit tests for edge cases like zero step, empty ranges, very large ranges, and negative steps.
“This was a lot.”