你会如何设计大富翁?

发布于 2024-10-20 09:59:39 字数 318 浏览 2 评论 0原文

可能的重复:
OOD 中的垄断游戏?

前几天的采访中我被问到了这个问题。显然它非常广泛,你不可能在短时间内涵盖所有内容。但我不确定我是否很好地回答了这个问题。最重要的是哪类事情值得提及?

在我被问到的问题的版本中,假设有 4 名玩家远程参与,游戏的简化版本 - 玩家可以滚动,他们可以购买财产,他们可以向其他玩家支付租金。

Possible Duplicate:
Monopoly game in OOD?

I got asked this question in an interview the other day. Obviously it's very broad and there's no way you're going to cover everything in the short amount of time you have. I'm not sure I did a good job of answering the question however. What sort of things are the most important to mention?

In the version of the question I was asked, assume there are 4 players who are participating remotely, and a simplified version of the game - players can roll, they can buy property, and they can pay rent to other players.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

零崎曲识 2024-10-27 09:59:39

他们很可能正在寻找您对对象的理解并将这些对象联系起来。甚至可能是数据库中的条目以及它们之间的链接(玩家、属性以及链接到对象的属性)。

They were most likely looking for your understanding of objects and linking those objects. Perhaps even entries in a database and links between them (players, and properties, and the properties linked to the objects).

夏末 2024-10-27 09:59:39

我认为问题中的关键词是“远程”所以我认为他们关注的是玩家如何与彼此和服务器交互?

您的答案中要涵盖的项目可能包括:

  • 它是基于桌面还是基于 Web 的应用程序 用户
  • 如何与其他对等点或通过中央服务器进行通信
  • 一个用户如何知道另一个用户何时执行了某项操作,每个用户是否轮询服务器?或者服务器向用户推送消息?
  • 您会使用什么技术堆栈? JMS、WFC、Applet、JavaScript?等等
  • 服务器需要什么负载来处理您需要如何扩展解决方案。让 100 个用户每 2 秒轮询一次服务器可能没问题,但对于 100 万用户来说可能不太理想。
  • 你需要消息队列/总线

吗?但是,如果问题是关于一般编程,我想你会谈论继承和对象、接口、数据库设计等。

I think the key word in the question is "remotely" So I think they were after how the players would interact with each other and the server?

Items to cover in your answer could include:

  • Is it a desktop or web based application
  • How do users communicate to each other peer - peer or via a central server
  • How does one user know when another use has performed an action, does each user poll the server? Or does the server push messages to the user?
  • What technology stack would you use? JMS, WFC, Applet, JavaScript? etc
  • What load does the server need to handle how scalable do you need to make your solution. Having 100 users poll the server every 2 seconds may be fine, but not probably ideal for one million users.
  • Do you need a message queue/bus
  • etc

However if the question was about programming in general I guess you would talk about inheritance and objects, Interfaces, database design etc.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文