Deliveroo interview question

How to optimize an existing algorithm