Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

As a C++-programmer in interviews I repeatedly found myself in situations were the interviewer wanted to probe my knowledge of good programming style. These typically were centered around basic knowledge of OOP.

I know OOP is useful to encapsulate concepts and I use it daily. However, since a language like C++ allows many different styles and some C++ approaches like TMP or STL algorithms are not OOP at all (but rather more like functional programming) I find myself stuck on how to best "sell" my knowledge of other approaches as well without coming across as arrogant or as somebody without appreciation of the basics. I fear this emphasis on OOP of the askers comes from them being socialized in the 90s where OOP was believed to be the cure-all, but that is an arrogant standpoint to take.

How would I make the best of questions like this?

share|improve this question

closed as off-topic by durron597, Snowman, MichaelT, enderland, GlenH7 Jun 26 '15 at 22:07

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking career or education advice are off topic on Programmers. They are only meaningful to the asker and do not generate lasting value for the broader programming community. Furthermore, in most cases, any answer is going to be a subjective opinion that may not take into account all the nuances of a (your) particular circumstance." – durron597, Snowman, Community, enderland, GlenH7
If this question can be reworded to fit the rules in the help center, please edit the question.

There are just a few handful concepts of basic OOP. Prepare a ready made code example for each of them and you should clear most of these. And yes an interview is to mostly satisfy the interviewer doubt of your knowledge on the subject and it's the worst occasion to have ideological quandaries. – eminemence May 7 '12 at 9:34

I would say you have to do your best answering this kind of questions, like you should do your best answering any kind of questions.

Later on when you are given the opportunity to ask the interviewer questions, you should raise the subject, asking questions like:

  • Do you only do OOP?
  • I use a different programming approach, how is it acceptable in your team?

And so on... and this way you can not only start a conversation about selling your expertise with those other approaches, you can also see how rigid and how much emphasis is really given to OOP in that team/company.

share|improve this answer

Don't worry too much about the asker's motivations, and just answer honestly. Remember, an interview is a two-way street. You don't want to get stuck in an ideologically inflexible company any more than they want to get stuck with you.

That being said, I think you're being a little paranoid about interviewers' intentions. An astounding number of supposedly professional programmers do not understand the fundamentals of OOP. 99% of the time, interviewers aren't trying to see if you drank the OOP kool-aid, but only want to see if you have a basic understanding of it. Even if you feel another paradigm is better suited for a certain solution, interviewers want to know that was an informed conclusion, and not borne of ignorance of OOP.

Rationalization is a very common defense mechanism when someone doesn't understand something. If people don't understand a concept, they argue the concept is stupid or inapplicable rather than admit their own ignorance. Even if you truly think OOP is a poor choice for an answer, you must nevertheless distinguish yourself from the rationalizers. The way to do that is to both explain the OOP solution and why you think it's a poor choice in that situation.

share|improve this answer
+1 for style questions being more about environmental fit . . . – Wyatt Barnett May 7 '12 at 15:16

I would emphasize that you follow SOLID principle, which is OOP and more. Not only does it guarantee that your code is object oriented, but that it's fashioned in such a way that substituting objects following the SOLID principle is a relatively straightforward task. Not only would it send the message that you know OOP, but it demonstrates that you understand the subtle points about what distinguishes good OOP code from hacky complicated OOP code written by someone who used to program in C and thinks all other languages should be programmed in the same fashion, since lets be honest, that's what makes you a good programmer, not just being able to use OOP.

Be prepared to thoroughly explain for each of the five principles why each is important and what might happen to code which ignores that principle.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.