Well, the correct answer to questions like that is something like "I don't keep that stuff in my head, but the last time I had to do [foo], I looked at what kind of data was likely to be coming in, took down my copy of Knuth/CLR/Sedgewick, and decided that [bar] was likely to give good performance given that kind of data."
You won't get the job, but that's the correct answer nonetheless. :-)
I call this "the moonwalking fallacy". It's the problem where you're asked a dumb question, and you give the sensible non-answer that demonstrates the underlying competence the interviewer is ostensibly looking for, but you lose to the next candidate who has the exact answer they're looking for on tap. And they can moonwalk.
Interviews suck and we should all stop doing them as much as we possibly can. There are much better ways to handle this problem.