Microsoft Interview Question

Iterating through an array using an algorithm