Other than throwing a few curve balls to see how you react, most hiring managers and interviewers are quite pleasant throughout the interview process. Every now and then, however, you may encounter someone who’s rude, aggressive or downright mean — which means you’re forced to find a cordial way to respond in the moment.

Instead of letting this catch you off-guard, prepare for this potential situation, just as you would every other aspect of the interview. Keep these tips in mind as you head into your next interview, and you’ll be ready to ace it no matter what happens.

Keep Cool, Calm & Collected

When someone is being rude or aggressive towards you, your first instinct might be to go on the offense. Rather than fly off the handle, resist the urge to snap back and, instead, stay cool, calm and collected. Start by taking a quick breather to compose yourself, even if that means asking to take a quick bathroom break to splash some cool water on your face.

Sometimes, an interviewer will throw in one or two rude comments or questions as a way of testing how you react to the situation. The last thing you want to do is appear unable to deal with difficult situations should they arise in the workplace. This is your chance to prove you can handle anything. 

Don’t Take It Personally

When someone is abrasive or rude, it’s helpful to remember that even the nicest people have bad days. Perhaps your interviewer is under a lot of pressure from their boss to find the perfect candidate. Or maybe she or he is experiencing hardship in their personal life.

Even if it feels like the hostility is directed towards you, chances are it’s not. Rather than take their abrasiveness personally, stick to your game plan and answer each question calmly and confidently. Take that bathroom break if you have to and come back ready to proceed and show your most gracious self.

Engage Them in Conversation

If something they say comes off as abrasive or hostile, use it as an opportunity to turn the conversation around. When the spotlight is on them, and you ask questions that show you care, their attitude may quickly turn from negative to positive. Why? Because people love talking about themselves. According to Scientific American, the reason for this is simple: it feels good.

If you’re feeling stuck in this moment, rely on these quick and easy questions to get your interviewer talking about themselves while learning more about the company:

  • How long have you worked at the company? 
  • What values and/or qualities made you choose this company?
  • What’s your favorite part about working at the company?

Don’t Be Afraid to Walk Away

While irritating and unprofessional, a few rude comments are likely a manageable aspect of what might be an otherwise okay interview. However, what’s not acceptable is for someone to attack you personally or make you feel unsafe. If you feel threatened, don’t be afraid to walk away:

“If you feel threatened during your interview or the situation crosses a line, let the interviewer know you don’t think you’re a good fit for this position and dismiss yourself from the situation. If you make it to the end of the interview, do your best to remain polite and leave with confidence. If you’d like to follow-up about the interview tactics or feel as though the interviewer crossed a line, consider following up with the company’s human resource department,” says Carson Kohler of Top Interview.

You can also file a complaint with The Equal Employment Opportunity Commission if you felt threatened or offended based on your being part of a protected class.

Dealing With a Hostile Interviewer

Having an interviewer who’s rude, hostile or aggressive can easily throw even the best, most experienced job candidates off their game. Rather than getting flustered and frustrated, use the tips and tricks above to help you stick to your game plan and land the job. If it gets to the point of harassment or you’re being personally attacked, it may be wise to walk away and follow up with someone else at the company. Use your best judgment and stay calm until it’s no longer feasible to do so and you’ll prove that you can handle any situation.

This article was originally published on Glassdoor.

Follow us here and subscribe here for all the latest news on how you can keep Thriving.

Stay up to date or catch-up on all our podcasts with Arianna Huffington here.