Tesla interview question

Write pseudo code for implementing a control loop. [interesting, but good question for an analog engineer]