If you’ve been on more than a couple of job interviews, chances are you’ve been asked something you’d rather not answer.

Are you married?

Do you have kids?

Where do you go to church?

Not only are these questions intrusive and offensive, in many cases they’re also illegal. If a question intrudes on a person’s “protected classes,” including age, race, religion, marital status or sexual orientation, the employer asking the questions can be sued by the Equal Employment Opportunity Commission.

“It happens more than they would like you to think,” says Justin Hirsch president of Job Plex, an executive search firm that’s a division of DHR International. “Human resource leaders are typically more careful and more straightforward, but other executives in the company may ask something unscripted that’s just on the top of their mind.”

Interviewers could be asking questions to try and establish a relationship to determine if a candidate will be a good fit with the company’s culture, but they have to be careful.

“Interviewers often try to strike up a rapport with an interviewee, and it can go from a structured interview to a friendly chat in a matter of seconds,” says Debra Bathurst, vice president of human resources for Oasis Outsourcing in West Palm Beach, Fla.  For instance, sharing the same alma mater can lead to asking the year of graduation and age, and inquiries about home location can lead to questions about place of worship—both illegal questions to ask during an interview.

“It really takes you into an area that’s forbidden, and if the person doesn’t get the job then they start to think, “Maybe I didn’t get the job because I’m over 40, or because I’m Jewish, and before you know it, that employer can end up with a charge on their desk from the EEOC,” says Bathurst.

Why it Happens

Typically, when an inappropriate or even illegal question is asked, it’s not intentional, Hirsch says. It may be that the hiring manager is simply trying to improve his or her interview session by discussing something other than work.

“Often times, the hiring managers may simply want to know, ‘How is this person going to work with me?’ ‘What is their personal life like?,’ but then they end up asking something that’s way too personal for a first-time meeting, let alone a job interview,” says Hirsch.

Some things can come up organically in a job interview, says Michael Dsupin, CEO of Talener, a tech staffing company. It’s often difficult to gauge what’s illegal and what’s not when you’re engaged in a conversation with someone, he says.

“Interviewers are looking for a person’s ability to shift gears and how they handle tricky questions. An interview is about finding common ground with someone and that’s a good thing. But lines get crossed, and if you’re looking for a job you have to be prepared for certain things,” says Dsupin.

Experts say the recent economic turmoil has led to more interview questions about candidates’ finances. These questions might be uncomfortable, but they aren’t illegal.

Since many job seekers have been laid off or out of work for several months or even years, an employer may want to ensure that they still have a stable home life.

“If a person was laid off, then an employer may want to verify that they still have a house within communing range or that they aren’t going to jump to another job in three months as soon as they find one that pays more money,” says Hirsch. “From an economic perspective, they have to find someone who is ready to commit, but also someone who is financially sound and stable enough to become a long-term employee.”

What to do When it Happens

Stay poised.  “You’ve got to remain unemotional when inappropriate questions come your way,” says Hirsch. “You don’t want to be elusive, and you don’t want to get emotional because that can turn an interview sideways and be a deal breaker.

He advises candidates offer a diplomatic response to questions that make them feel uncomfortable. As opposed to saying, “That’s a terribly inappropriate question,” interviewers can say, “I prefer not to answer that at this time.”

“Saying you prefer not to answer is more thoughtful and classy,” says Hirsch. “If you tell an interviewer they are being inappropriate then you put them on the defensive and they can get combative. You’ve got to keep the interviewer happy while not looking like you’re trying to cover something up.”

If it’s relevant to the job, answer the question without really answering the question. If a woman is applying for a job at a bridal boutique, a logical question might be to ask if she is married and has experience with weddings, says Hirsch. While an applicant’s first response might be a definitive “yes,” or “no”, Hirsch says there’s another way to answer without showing all  your cards.

“Even if it’s somewhat relevant to the job, it’s still an illegal question, so I would advise that person to be diplomatic and say something like, ‘I have been a part of many weddings, and I have experience planning weddings.’ It’s a way the candidate can speak to their relevant experience without having to reveal too much.”

Since having experience with church life or children can often be critical to a job, Hirsch advises that interviewees highlight as much of their experience as possible without directly pointing to their personal lives.

Turn it around.  “If someone is going to be bold enough and ask if you have kids, you don’t have to answer that,” says Bathurst.

“Look on their bookshelf or their desk, and say, ‘Oh, it looks like you do,’ and do your best to get the interview back on track as a candidate,” she says. “If they persist and ask three or four questions about the same thing, then I’m not sure that’s the best place for you to work.”

Candidates should never be afraid to reverse the issue and ask the same question that’s being asked of them, she says. It can’t hurt, and it could end up opening up the dialogue and making the interview more comfortable.

Be honest and don’t get defensive.  “If an interviewer says, ‘Hey, are you married?’ I would just be honest. If you are divorced, it’s not a crime. You didn’t do anything wrong,” says Dsupin.

Know yourself, know your resume and be ready to answer everything that comes your way honestly, he adds.

You never want to come off as defensive or aggressive in your response,” says Dan Finnigan, CEO of Jobvite. “Your role should be first and foremost to stay professional, stay light, and give the most appropriate response.”

Ask yourself:  Why are they asking me about my age? If an employer is curious about your age, he or she may want to know if you’re married and have a family, says Finnigan.

“Ask yourself why they want to know your age or marital status. Is the job long working hours with young people who don’t have families? Think to yourself, where is this question going, where is the thought process behind it,” he says.

If the questioning persists, Finnigan says it’s perfectly acceptable to ask the interviewer why the question is so important.

“Don’t be afraid to say, ‘Help me understand why this matters, because I want to better understand the job I’m interviewing for.’”