Pregunta de entrevista de Terradepth

How would you design a controller for this application?