Redfin Interview Question

Coding problem for an elevator.