Implement custom iterators and interfaces | Coinbase Interview Question