Pregunta de entrevista de Modern Health

How would clean up this code?