Block Interview Question

Design an algorithm to control an elevator.