Roke Manor Research Interview Question

How would you optimise your code/algorithm?