ServiceNow Interview Question

How do you find the most efficient algorithm?