CoinTracker interview question

How to optimize a piece of code after I had solved the coding challenge.