The interview process is hard enough without having to deal with illegal interview questions but the truth is that some employers just don't realize that there are certain questions that they cannot ask. There are some questions that are literally illegal that you do not have to answer.
These questions cover:
Children and pregnancy
But, if you are asked a question regarding one of these areas, you can't just say, "You can't ask me that!" because that won't get you the job.
What can you do? You can try to determine the reasoning behind the question. Find out what they really want to know. Often times, when they ask one of these questions they really just want to know if you are capable of doing the job and if there is anything that will prevent you from doing the job. They may be concerned about how long you are going to hang around, too.
Instead of saying, "You can't ask me that!" try to assure them that you are old enough to work or that you plan on working for many more years or that you have the skills to do the job.
If they press the question, you can tell them that you don't believe your age/marital status/nationality/etc. will affect your ability to do the job. Follow up by giving them an example of how you have done this job or a similar job in the past.