Capital One interview question

How would you further improve your solution?