由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - amazon 面经
相关主题
版上牛人能不能帮忙看道面试题?问一道多线程面试题
设计一个 restaurant reservation system?脸家 System design 新题, 求指点
Amazon电面面经一个朋友double报销面试cost,黑名单了
amazon一面FL面经
明天onsite,求祝福,同时发Amazon电话面经一个,攒rpSQL, recruiter发过来的面试题
LinkedIn面试被老印郁闷到了.....C#, recruiter发过来的面试题
How to design the sql for this problem? (转载)C#, recruiter发过来的面试题, 帮我看看解答
一道面筋题目~amazon 电面
相关话题的讨论汇总
话题: int话题: abstract话题: public话题: void话题: matrix
进入JobHunting版参与讨论
1 (共1页)
h******e
发帖数: 52
1
OOD Design 一个mine game, 也就是以前windows里的自带的挖雷游戏。 不需要具体实
现,只需要加注释说明干什么。 欢迎牛人指点下面的design有什么问题。
abstract class GameBase
{
abstract public void startNewGame(int level);
abstract public void endCurrentGame();
abstract public DateTime getTimer();
abstract public void click(int row, int col);

}
class MineGame : GameBase
{
private int userLevel;
private int matrix[,];
private int maxRow;
private int maxCol;
private long timeDuration;

//This will initialize all the need variable like level, matrix
//Preset some of the mines in the matrix
//Go through the matrix to figure out the numbers for the cell which is
not mine
override public void startNewGame(int level)
{


}

//Clean up everything to close the game
override public void endCurrentGame()
{
}

//Get current time duration to show to user
override public DateTime getCurrentTimeDuration()
{
}

//user action
//if matrix[row, col] is mine, call endGame
//else {
if(the number of mines around this cell is equal to this number
uncover all the neighbors and itself
else
uncover itself
}
abstract public void click(int row, int col)
{

}
h******e
发帖数: 52
2
自己re 一个

【在 h******e 的大作中提到】
: OOD Design 一个mine game, 也就是以前windows里的自带的挖雷游戏。 不需要具体实
: 现,只需要加注释说明干什么。 欢迎牛人指点下面的design有什么问题。
: abstract class GameBase
: {
: abstract public void startNewGame(int level);
: abstract public void endCurrentGame();
: abstract public DateTime getTimer();
: abstract public void click(int row, int col);
:
: }

l******s
发帖数: 3045
3
Why do you need an abstract class? What's expecting to extend? If using an
abstract class without any implementation, why not an interface?
Not to challenge, just to ask.
h******e
发帖数: 52
4
这里Interface比abstract好,当时考虑的是还有一些可以在baseclass里做,后来没有
想到有那些,也没有时间去改了。 当然这里还有很多要改近的地方。 整个design只有
十分钟时间左右,也不多结果做讨论,我就想知道, 这种考法,面试官想知道什么?
1. OOD基本概念,封装,继承和多态
2. 思考问题的方式,比如怎么样和面试官交流,得到requirement
3. class里面的完整性 - 这个很难如果那个东西你不了解的话。

【在 l******s 的大作中提到】
: Why do you need an abstract class? What's expecting to extend? If using an
: abstract class without any implementation, why not an interface?
: Not to challenge, just to ask.

1 (共1页)
进入JobHunting版参与讨论
相关主题
amazon 电面明天onsite,求祝福,同时发Amazon电话面经一个,攒rp
Java developer Opening(Junior) at MDLinkedIn面试被老印郁闷到了.....
还在招,在招Java developer DC H1-B在招 (转载)How to design the sql for this problem? (转载)
请教一下,如何练习设计类的面试题目?一道面筋题目~
版上牛人能不能帮忙看道面试题?问一道多线程面试题
设计一个 restaurant reservation system?脸家 System design 新题, 求指点
Amazon电面面经一个朋友double报销面试cost,黑名单了
amazon一面FL面经
相关话题的讨论汇总
话题: int话题: abstract话题: public话题: void话题: matrix