R3 Solutions interview question

How could you improve your code?