Klaviyo interview question

How can you make this more efficient?