Microsoft interview question

Producer Consumer problem