Sollicitatievraag bij Auto & General Insurance

How would you solve a problem to minimise performance implication? You may need to explain the algorithm or write pseudo-code.