AMD interview question

What is deadlock? How does semaphore work?