But there is a catch that is very likely not obvious here. All the numbers in the array are (were) unique (and the zero was not present).
Some information is actually missing/not obvious and interviewers may actually evaluate your reaction to this situation because this would also model (to some degree) a real life situation.
So I added the missing bits (and fixed typos).
You have an array size of n of integers from 1 to n, that is not sorted. There are no duplicate numbers in this array.
One of the numbers got changed to 0. Given the array after the change return the changed number in linear time and constant space.
Assume the same array but two of the numbers got changed to 0. Given an array after the change return the changed numbers in linear time and constant space.
The first part of this problem should be simple. The second part is more tricky.
Ok, so here is an anecdotal sample. I have not seen this problem before.
After reading the problem description I tried one round of the game on the paper (actually in the text editor) to get the feeling of the game play and then it took me about few minutes to come up with one possible solution and then after a little bit of thinking with a more optimal one.
So not impossible (but I was in comfort of my home).
I actually think that this is a rather classical CS problem that does not require some thinking about more abstract mathematical corner cases.
I give an example of the later one.
You have an array or numbers [1 - n], that is not sorted. One of the numbers got changed to 0. Given an array after the change return the changed number in linear time.
Assume the some array but two of the numbers got changed to 0. Given an array after the change return the changed numbers in linear time.