I have definitely blown this question in an interview before and would probably also argue that it’s bad. Now that I’ve run into it once, I’ll know how to do it in the future, which to me seems to imply that it’s just measuring whether or not I’ve seen it before. During the same period of interviewing, I was also asked the reservoir sampling puzzler and nailed it simply because I’d been exposed to it by friends.
You hit the key of it: “Is this question just asking whether you’ve heard this question before?” For all of these gotcha questions, the answer is “yes”. I’m really glad there’s a backlash against this now. I’ve hired some great people who were awesome problem-solvers but didn’t bother to memorize tables of interview questions, probably because people like Google didn’t know enough to snap them up first.
I’ve been asked this question too, and I gave one answer (the same as in the blog). The interviewer then proceeded to give me 3 more ways you could solve the same problem, each more esoteric than the previous. It was clear he had Googled the answer before the interview because as the blog says, this isn’t really a problem you’d face in real life.
I didn’t get the job.