Pergunta de entrevista da empresa EchoStar

Difference between mutexes and semaphores? When and why are they used?