Pergunta de entrevista da empresa Terradepth

How would you design a controller for this application?