PepsiCo interview question

How to improve your code to be more efficient?