GlobalLogic interview question

write a program of producer consumer without using concurrency