Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OOP Problems to use for Coding Tests during interviews

Tags:

oop

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 really exercise peoples OO abilities. I tend to try and keep the coding problem solvable within 2 hours ish. So, I've struggled to find a problem small enough and involved enough that it exposes peoples OO design skills.

Any suggestions?

like image 727
Keith Nicholas Avatar asked Oct 29 '08 04:10

Keith Nicholas


People also ask

How do you explain OOPs to an interview?

In an interview , when you are asked explain OOP concepts, just do not list them out. Tell one at a time and then explain what it means. Do not stop there . Be creative and give a real world example to illustrate the concept and then explain how to implement it using a language you know .


1 Answers

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.

like image 84
Jon Limjap Avatar answered Sep 30 '22 00:09

Jon Limjap