Cognizant interview question

Producer consumer problem, Java concepts