Today i had an interview and i was asked a question.
Suppose you have an array with 1 to 10000 numbers. If one number is replaced by -1 at an index let say 546 . This array is given to me and i am asked to find out which was the number replaced by -1.
My answer was it is impossible to tell the number which is replaced by -1 when i got the array with replaced number.
It would depend on whether or not you have the previous array or if there were any -1s in the array before it got changed. In the most general case, I would agree with you.
Unless they wanted you to try and see how the bits 'used' to be,like with some data recovery software that sees of a bit is closer to 0 than 1 or vice versa and tries to guess the previous value. But, that's probably outside the scope of the interview...right?