Microsoft interview question

Describe Semaphores and Deadlocks