Object-Oriented Programming · Google · Medium
Approach 1: Lazy Replication with One Queue per Consumer A simple correct design is to give every returned iterator its own queue. The source is not read in advance. Instead, when a consumer asks for a value and its queue is empty, the coordinator obtains one new value from the source and places a copy into every queue. For example, suppose the source produces 10, 20, 30, 40 and there are two consumers. If the first consumer requests two values, both queues receive 10 and…
Checking your access…