Cleartrip interview question

asked to implement a task scheduler