Google Interview Question

you need to know basic understanding of time complexities.