Pregunta de entrevista de CU Direct

How would you improve this code?