Pregunta de entrevista de AMD

What is deadlock? How does semaphore work?