⟩ How to refuse answer of the illegal question?
Inform the interviewer that the question doesn't seem to be legal or relevant to the specific requirements of the job. Be forewarned, though, that such a direct response should really be saved for questions that are offensive or deeply troubling.