Persistent Systems Interview Question

What was producer-consumer problem and write its code? Explain deadlock and its prevention techniques. Explain semaphores. (L2)