Microsoft interview question

Write a robot motor controller from scratch.