That is, I think, the problem with posing a question like this. I can only speak about what I'd do. This question would kick my mind into "real-world" mode. I'd want to compare alternative approaches and generally talk it out.
If this is not what the interviewer wanted, they'd be better served by asking a slightly more fantastical question that would still show problem-solving skills. Also, the interviewer should qualify the question by saying that "this isn't a real world situation, I just want an algorithm". I don't know how someone would react to that situation.
If this is not what the interviewer wanted, they'd be better served by asking a slightly more fantastical question that would still show problem-solving skills. Also, the interviewer should qualify the question by saying that "this isn't a real world situation, I just want an algorithm". I don't know how someone would react to that situation.