Heartbeat Health interview question

Simple coding exercise on how you would design an algorithm used in an elevator.