Pergunta de entrevista da empresa Block

Design an algorithm to control an elevator.