EY Interview Question

Write an algorithm which has a complexity of O(logn).