Microsoft Interview Question

Two sum question and its time complexity.