ServiceNow interview question

How do you find the most efficient algorithm?