Inspired by some old post by Paweł Brodziński, I wanted to share with you one of my killer job interview questions. Why you may ask? Am I just shooting myself in a feet? I don’t think so.

To be honest, there are actually two questions:

  • How would you define object-oriented programming?
  • You have a task to design C# vNext. Out of the three: inheritance, polymorphism and encapsulation you are allowed to use only two. You just have to get rid of one. Which one would you get rid of?

The sad truth is more than 90% people fail to answer the first question (and we are usually not hiring many juniors). Stories about animals living in a zoo won’t convince me you understand OOP.  The fact is, many people write code in OO languages such as C# but their understanding of object orientation has not evolved since reading their first OO textbook. Out of  fifteen people I interviewed recently, only one could tell me what polymorphism is. Bunch of hints if you’re going to have a job interview with me:

  • read some classics of OOP even if they are not so current (Bertrand Meyer’s Object-Oriented Software Construction and/or Streamlined Object Modelling)
  • start reading Eric Lippert’s blog about C# to be up to date with latest C# puzzles
  • read CLR via C# to know how OO concepts map to CLR
  • read the f*** definition of OOP (the one mentioning inheritance, polymorphism and encapsulation)
  • understand these three features and how their relations (can I have inheritance without polymorphism? what about the other way round?)
VN:F [1.9.22_1171]
Rating: 4.4/5 (10 votes cast)
Interview killer question, 4.4 out of 5 based on 10 ratings