The interviewer must have been referring to problem solving and logic skills, which is part of the everyday work of a programmer. When given a problem, you need to be able to analyze it, subdivide it, and write a solution for it by using the most optimal approach.
You could argue how well a puzzle like that represents your ability to do this. I don't see the merit of asking a puzzle question instead of just asking a real life programming problem.