ClearMotion Interview Question

How would you optimize the time complexity of your algorithm?