Salesforce interview question

How would you write a program for an elevator?