Yahoo interview question

Producer / Consumer problem