Deliveroo Interview Question

How to optimize an existing algorithm