Pariveda interview question

Develop an algorithm for optimizing an elevator control system.