OOP Problems to use for Coding Tests during interviews

后端 未结 9 2087
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-31 12:00

As a second interview I get people to sit down and write code...I try to make the problem really technology independent.

My programming problems that I have don\'t reall

相关标签:
9条回答
  • 2021-01-31 12:23

    Whether or not people do some coding in the interview, I make it a point to ask this: Tell me about a problem you solved recently using object oriented programming. You'd be surprised how often people cannot answer that simple question. A lot of times I get a blank stare, or they say something like "what do you mean? I program in .NET, which is all object oriented."

    0 讨论(0)
  • 2021-01-31 12:24

    How about some sort of simple GUI. It's got inheritance, overriding, possibly events. If you mean for them to actually implement as part of the test then you could hand them a blank windows-form with an OnPaint() and tell them to get to it.

    0 讨论(0)
  • 2021-01-31 12:26

    This is a problem that I use with some trainings, looks simple but is tricky OOP-wise:

    Create model classes that will properly represent the following constructs:

    1. Define a Shape object, where the object is any two dimensional figure, and has the following characteristics: a name, a perimeter, and a surface area.
    2. Define a Circle, retaining and accurately outputting the values of the aforementioned characteristics of a Shape.
    3. Define a Triangle. This time, the name of the triangle should take into account if it is equilateral (all 3 sides are the same length), isoceles (only 2 sides are the same length), or scalene (no 2 sides are the same).

    You can go on and on with quadrelaterals (which include squares, rectangles, rhombi, etc) and other polygons.

    The way that they would solve the above problems would reveal the people who understand OOP apart from those who don't.

    0 讨论(0)
  • These aren't specifically OO Questions, but check out the other questions tagged interview-questions

    Edit: What about implementing some design patterns? I don't have the best knowledge in the area but it seems as if you would be getting two questions for the price of one. You can test for both OO and Design pattens in the one question.

    0 讨论(0)
  • 2021-01-31 12:38

    I've got a super simple set. The idea is mainly to use them to filter out people who really don't know their stuff rather than filtering in the rock stars.

    These are all 5 minute white-board type questions, so they are really not that hard. But the act of writing up code, and talking through it reveals a lot about a candidate - and is brilliant for exposing those that can otherwise BS through the talk.

    • Write a method that takes a radius of a circle as an argument, and returns the area of the circle (You would be amazed how many people struggle on this one!)
    • Write a program that accepts a series of numbers as arguments from the command line. Add them up, and print the sum
    • Write a class that acts as a keyed counter (basically a map that keeps track of how many times each key is "counted")
    0 讨论(0)
  • 2021-01-31 12:42

    I have used the FizzBuzz Programming Test. And shockingly can corroborate the claims made by the article. As a second follow up I have asked candidates to compute the angle(s) between the hands on an analog clock. We set up a laptop with VS 2008 installed and the stub in place. all they have to do is fill in the implementation.

    I am always stunned at how poorly candidates do on these two questions. I really am.

    0 讨论(0)
提交回复
热议问题