面试过程中用于编码测试的OOP问题 [英] OOP Problems to use for Coding Tests during interviews

查看:83
本文介绍了面试过程中用于编码测试的OOP问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为第二次面试,我让人们坐下来编写代码...我试图使问题真正与技术无关.

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

我的编程问题并没有真正锻炼人们的OO能力.我倾向于尝试在2小时内解决编码问题.因此,我一直在努力寻找一个足够小的问题,并且涉及的程度足以暴露人们的OO设计技能.

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.

有什么建议吗?

推荐答案

这是我在一些培训中使用的一个问题,看起来很简单,但在OOP方面却很棘手:

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. 定义Shape对象,该对象是任何二维图形,并具有以下特征:名称,周长和表面积.
  2. 定义一个圆形,保留并准确输出上述Shape的特征值.
  3. 定义一个三角形.这次,应考虑三角形的名称是等边的(所有3个边的长度相同),等腰(仅2个边的长度相同)还是斜角(没有2个边的长度相同).

您可以继续使用四边形(包括正方形,矩形,菱形等)和其他多边形.

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

他们解决上述问题的方式将揭示那些了解OOP的人和不了解OOP的人.

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

这篇关于面试过程中用于编码测试的OOP问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆