Pregunta de entrevista de Tata Consultancy Services

How does a semaphore work?