Domanda di colloquio di Medallia

How would you advise simplifying this code?