One would like to think that all interviewers know how to properly conduct an interview, but that isn't always the case. Not only do some employers ask ineffective questions, but some ask illegal questions. When that happens, what are you supposed to do?
The most basic answer is, "You choose to answer it or not."
However, you would be wise to read this article! It lists illegal questions (and the ones that are allowed that you might hope are illegal) as well as some ways to handle illegal questions.