D2L interview question

How would you improve your solution ?