Before Josh Weiss founded TeliApp, a company that develops smart phone apps, he was a programmer. In several job interviews early on in his career, he was asked to recite specific codes, a question he thought was ridiculous because programmers can simply look up code.

One day, in response to that question, he replied, “That’s not the right question. No one memorizes code. You should be asking me how I would solve specific problems.”

Apparently that was the answer the interviewer was looking for because the interviewer didn’t even wait until Weiss left the office to offer him the job.

How you respond to difficult interview questions often will determine whether or not you get hired.

So it is important to try to anticipate the questions you are likely to be asked at a job interview. Fortunately, interviewers are generally not that creative, and there are a number of tough questions that are frequently asked. If you are properly prepared, your answers will not derail your candidacy and can even help propel it forward.

Here are some of the commonly asked questions that an unprepared candidate might mishandle.

Garrett Miller, CEO of Productivity Training Company CoTria and author of “Hired Right Out of College — From Classes to Career,” points out that any interview question that “hints at what you didn’t like about an event, person or position can be tricky.”

For example, in response to questions like “What did you like least about your last job, boss or team?” or “Why did you leave your last position?” Miller advises “stay positive.”

He suggests “when addressing a person or company’s deficiencies, to let the interviewer know that, though there were some aspects about the job that were more difficult than others, you developed a flexibility and it taught you how to adapt when situations are not ideal.” He adds “be ready to give an example.”

Lisa B. Marshall, author of “Ace Your Interview,” notes that a common question candidates have difficulty with is “What is your biggest weakness?” Many people don’t know how to respond.

“Don’t answer with ‘I don’t have a weakness’ because it makes you look arrogant,” she advises.

Some like to choose something that can be considered a weakness or strength but that is not really effective.

Some volunteer a personal trait, but that’s never a good idea because personal traits are seen as permanent damage. Instead, choose something that the interviewer is already aware of, such as a technical or background experience weakness, since this is viewed as repairable.”

Career coach Joanne Dennison notes that some questions are difficult because simply answering them does not demonstrate why you should be hired. Questions like “Are you a team player?” or “Do you work well under pressure?” require more than simply answering.

“You need to show them, not tell them,” Dennison advises. Be prepared with a story that shows how you were a team player, dealt with pressure or took initiative.

Robert Byron, a principal consultant at WinterWyman, points out the pitfalls of responding when asked about your salary expectations. Often this question is used to screen out candidates.

“Instead of giving specific numbers,” he suggests that you “address how you are very interested in the role and responsibilities of the position and are flexible when it comes to salary.

If pressed, offer a range to prevent being ruled out and leaving room for salary negotiations later in the process.”

Amanda Augustine, career expert for TheLadders.com, addresses the question that almost all interviewers ask, and for which a failure to have a good answer can doom the interview — “Tell me about yourself.”

This question is designed to see if you are a good fit with the organization.

Augustine notes that “the interviewer does not want to know that you love long walks on the beach (unless that’s part of the job). And, you’re not doing yourself any favors by asking the interviewer what they want to know about you.”

She advises, instead, “before the interview, review the job description and think back to your initial phone-screen to determine the core must-haves for this role. Use those top requirements to develop talking points that demonstrate how you are qualified for the role.”

Tough questions are an opportunity to both sell yourself and stand out from the other applicants.

Use them to show how you would add value to the organization and why you would be a good fit. Think of examples that support those answers.

The only way you will be able deal with difficult questions is to be prepared for them.

A veteran human resources executive, Lee E. Miller is career coach and the author of “UP: Influence Power and the U Perspective — The Art of Getting What You Want.” Send questions to Lee@Employability-Expert.com.