Amazon Interview Question

analysis of a certain algorithm