Pergunta de entrevista da empresa Epic

How would you implement an algorithm for elevator?