PepsiCo Interview Question

How to improve your code to be more efficient?