Be careful out there, employers. Job interviews have rules.

For instance, earlier this month, Massachusetts passed groundbreaking legislation banning employers from asking job applicants about their salary history. For Bay Staters, the law is meant to help close the gender wage gap, forcing managers to make offers based purely on a candidate's value to a company.

So what else aren't employers allowed to ask prospective employees? Quite a few things, actually.

This is a topic many people could stand to learn more about. A CareerBuilder survey last year found that 20 percent of hiring managers have asked an illegal question in an interview. A third of the more than 2,100 hiring and human resource managers polled said they were unsure of the legality of certain interview questions. Taboo topics also can come up during small talk, which is potentially just as damaging. "People chit-chat in interviews, and it's natural to talk about things that might give you information that's not job-related, but could be used to discriminate against a person," labor attorney Peter Moser told Huffington Post.

A basic rule of thumb is that all questions need to be job-related. For a start, anything that touches on age, race, gender, religion, marital status, and sexual orientation are not okay. Here's a look at 11 red-flag inquiries:

1. "How old are you?"
Many jobs require applicants to be over 18, and an employer can ask exactly that; anything else is problematic. The Age Discrimination in Employment Act of 1967 prohibits discrimination against anyone 40 or older on the basis of age. There's no equivalent federal protection for people who are younger than 40, although some states have laws on the books to that effect. And generally speaking, it's still an off-limits question. Beware the sly version by those who can do some fast calculating: "When did you graduate?"

2. "Are you married?"
This extends to just about anything related to personal relationships and family, including whether you have or plan to have children. Conversations around these subjects can lead an applicant to disclose information that opens a variety of doors for discrimination, say on the basis of pregnancy, marital status, or sexual orientation. Often child-related questions are an employer's way of sussing out how committed you'd be, so it could pay to answer by telling an employer you're able to handle the hours required by the position.

3. "What religious holidays do you celebrate?"
This is another question that may be posed as a way to learn more about your schedule, especially as it relates to your availability for holidays and weekends. But anything relating to your religion is verboten. The better route for employers is simply to ask whether you're available to work on specific days. Watch out, too, for inquires into what clubs, unions, or other organizations you belong to; the answer may reveal religious or other types of affiliations and, again, it's off-limits. Employers may, however, ask whether you're a member of any professional organizations.

4. "How's your health?"
While such a broad question isn't allowed, employers do have the right to thread the needle if they need to make sure you're up to the task of performing specific, physical aspects of the job. For example, they can ask if you can lift packages up to 50 pounds, or whether you can stay on your feet for six hours at a time. In addition, the Americans with Disabilities Act prohibits employers from asking about the existence or nature of any disabilities, though they may ask whether a person would need "reasonable accommodation" to do the essential functions of a job.

5. "What's your race?"
While a job application may include a space where you voluntarily indicate your race, it's illegal for an employer to ask the question outright.

6. "What country are you from?"
Variations on this illegal query include: Is English your first language? Are you a U.S. citizen? Employers can, however, ask if you're authorized to work in the U.S., or if you read, write, or speak fluently in any other languages.

7. "Have you ever been arrested?"
Arrest records are personal information, although in cases where the transgression might be uncovered by an employer, some experts say it could pay to volunteer the information and assure your potential employer it's a thing of the past. (Remember, everybody Googles.) It is, however, okay for an employer to ask if you've ever been convicted of a crime. Depending on the state, a conviction doesn't automatically disqualify you for employment unless it relates to your job in a significant way.

8. "Have you ever used drugs in the past?"
With this one, it pays to be mindful of phrasing. First, just asking about drugs is woefully unclear, as it lumps substances like heroin and cocaine in with prescription drugs. Second, it's illegal to ask about past drug use and addiction; however, employers are allowed to ask if you currently use illegal drugs.

9. "Do you like to drink socially?"
This one violates the Americans With Disabilities Act. If you're a recovering alcoholic, treatment is protected under the act and therefore any related information doesn't have to be disclosed. It may seem like an odd thing to ask in the first place, but employers sometimes wander into this territory as part of an attempt to determine how well you'd fit into company culture.

10. "Have you ever filed for bankruptcy?"
Same goes for any questions relating to debt or how well you balance personal finances. Employers must have permission before asking about your credit history. Like with a criminal background history, they can't disqualify you from employment unless it directly affects your ability to handle the position.

11. "What type of discharge did you receive in the military?"
Employers can, however, ask about education, training, or work experience you received while serving. In addition, if you're in the Reserves or National Guard, it's illegal to ask if you'll be deployed anytime soon.

If you find yourself faced with any of these questions, you're of course free to answer — but be mindful that you're giving information that is not job-related and which could influence, for good or for ill, your chance of landing the position. Another option is to politely decline to answer, a route that's admittedly easier said than done; who wants to risk appearing uncooperative? Some experts suggest trying to deduce the intent behind the question and then responding with the information employers are actually seeking (as with the aforementioned child queries, which can mask concerns about your schedule and availability).

When all is said and done, if you do think you've been subjected to discrimination or denied a job because of your refusal to answer an illegal question, your best resource is the U.S. Equal Employment Opportunity Commission. You can learn more about the laws and, if you want, file a charge of employment discrimination.