Employers usually ask many different questions during interviews to analyze the nature of the candidate. Previously these questions were of a wide variety, but recently laws have been made to define what type of questions are permitted in an interview.
Questions pertaining to elements like race, religion, beliefs, marital status and age of an applicant are illegal and must not be asked. The tale of prejudice in hiring, however, does not end here. While employers may not discriminate openly about the above-mentioned elements, they can still be biased about several other features not mentioned in the law such as the appearance or economic background of a candidate.
An employer looks for the best job fit and but where they may have a high degree of authority, they can still not cross the boundaries concerning the aforementioned elements that protect you as an interview applicant. When put in a situation where you are asked illegal questions, you can tactfully let the interviewer know that you are aware of the legal rights you possess. This will make the interviewer watchful in the future when conducting interviews. Another option would be to lie to the interviewer.
If they do not have the courtesy to abstain from an illegal question, so be it. The legal way to pursue this issue would be to hire an attorney who helps you file a complaint with the Equal Employment Opportunity Office. This will help address the problem from a legal point of view, and the company will face the consequences of asking illegal interview questions.