Question d’entretien chez Capital One

How would you go about making this code simpler? Basic Big(O) type questions for common data structures