For some reason many senior engineers cannot answer questions of this type. These types of questions are meant to see if someone can write programs in language X. They are also followed up with exploratory 'what if' questions that enable the interviewer to inspect the thought processes of the candidate. They are also used in behavioral interviews.
The person interviewed isn't senior. The one interviewing is.
I think her solution for array larger than memory is very inefficient. Even in smaller case one might achieve speed up by excluding unnecessary read/temp/move in else clause by just by writing two values which will likely be in registers.