Cisco interview question

Write a scripts for the elevator and algorithm on which call should get rpiority