Citi interview question

Consumer/Producer Problem