D2L Interview Question

How would you improve your solution ?