Inaccurate problem statement


All variants apply (save the last one), since, say, O(1) function is O(exp(N)) as well when N goes to plus infinity. To fix the problem the variants should be in terms of Theta or Omega.


no man, this is like we say for example the time complexity of merge sort in big O notation is nlogn although n^2 ,n^3 etc. are also there, but we say it is nlogn,so we always choose the minimum one


Yes, merge sort complexity is O(n*log(n)), and it is O(n^2), and it is O(n^3). If we want the interviewee to choose “the minimum one”, then we should crearly say that in the problem statement, in words. Or we can use less ambigous Omega notation. We can’t simply ask “What is the time complexity of the following code?” if there are many correct variants following.