MotorLeaf Interview Question

How did you choose this algorithm?