OOP Problems to use for Coding Tests during interviews

后端 未结 9 2090
爱一瞬间的悲伤
爱一瞬间的悲伤 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: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.

提交回复
热议问题