面向对象设计的问题,访谈 [英] OOP Design Problems in Interviews

查看:193
本文介绍了面向对象设计的问题,访谈的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一名软件开发人员2年的经验。我曾参与设计和几个小模块的开发。

I am a software developer with an experience of 2 years. I have been involved in design and development of several "small" modules.

我最近一直提供技术面试。我一直在问到模型的各种设计问题(例如苹果Genius推荐系统等)。我的专长迄今已在开发相对较小的模块。我想提一提我如何着手设计问题手:

I have been giving technical interviews lately. I have been asked to model design of various problems (for example Apple Genius Recommendation System etc). My expertise so far has been in developing relatively small modules. I want to mention how I approach design problems in hand :

(1)认识最重要的用例。

(1) Recognize most essential use case.

(2)不要动感的造型(如协作图)对行为的基础模型系统

(2) Do dynamic modelling (like collaboration diagram) to model system on basis of behavior

(3)基于在步骤2中做动态建模绘制类图。

(3) Draw class diagram based on dynamic modelling done in step 2.

(4)了解更多的用例和重复这一过程。

(4) Find out more use cases and iterate this process.

(5)当我很满意,我问我的同龄人有检讨吧。

(5) When I am satisfied, I ask my peers to have a review it.

虽然我已经在我的项目做得不够公平,到目前为止,但面试官没有pretty高兴使用这种方法。我缺少的东西,因为我对造型的大问题?

Though I've done fair enough in my projects so far, but interviewers are not pretty happy with this approach. Am I missing something as I am modelling for a big problem?

I'ld AP preciate任何指针。

I'ld appreciate any pointers.

P.S。 :我不下手类图,因为我觉得这样做很集中式架构,而动感的造型帮我分散设计

P.S. : I don't start with class diagram because I find very centralized architecture by doing so, while dynamic modelling helps me to decentralize the design.

推荐答案

你已被要求对高级别车型(模块)的设计或低电平模型设计?解决了一个大问题,或域高层次模型设计是一个好主意,因为对于低级别车型的设计通常需要较小的问题或域。

Did you have been asked for high level model (module) design or low level model design? Tackling into a big problem or domain for high level model design is a good idea, since for low level model design usually takes smaller problem or domain.

通常的要求/问题来自于提问者(用户/采访),所以我们不需要再定义业务需求。但是,我们仍然需要设计系统。

Usually the requirement / problem comes from the asker (user / interviewer) so we don't need to define the business requirement anymore. But we still need to design the system.

高级模式

我不是很熟悉的苹果Genius推荐系统,所以我会用不同的比喻的问题,那就是常见的销售点的问题。对于高级别车型中,将定义整个系统。通常约:

I'm not quite familiar with "Apple Genius Recommendation System" so I will use different problem analogy, that is the common Point Of Sales problem. For the high level model, you will define the entire system. Usually about:


  • 排序

  • commiting为了

  • 首付

  • 货物配送

  • 收益

这是所有高层次模型/模块。如果我被我如何能实现模型问,这里是我会做的步骤:

That is all high level model / module. If i'm being asked by how I can achieve the model, here is the steps that I will do:


  1. 定义用户与系统之间的标准使用情况

  2. 倒入用例的一些合作图等丰富的图片(或任何熟悉)

  3. 定义异常用例。如果异常可以很容易地定义,把它immediaetly模型。如果没有,用标志的情况下例外模型与业务团队进行进一步讨论

  1. Define the standard use case between user and systems
  2. Pour the use cases to some collaborated diagram such as rich picture (or anything familiar)
  3. Define the exceptions use cases. If the exceptions can be defined easily, put it immediaetly to model. If not, mark the model with the case exceptions to be further discussed with business teams

一些用例的异常可以改变承诺订单,首付后更改提交订单,取消订单所许,商品缺货等。

some use case exceptions can be changing committed order, changing committed order after down payment, cancelling payed order, goods out of stock, etc.

迭代的过程。通常第3步能够成为第1步(异常可以/将是另一个用例)

Iterate the process. Usually step 3 can become step 1 (the exception can / will be another use case)

例如变化的承诺顺序可以是一个用例,因为发生的文化变革是很高的。

for example the changing committed order can be a use case, since the change of occuring is high.

在第三个是没有额外的用例异常完成(所有用例已处理),通常我想补充价值的附加操作

When the 3rd is completed without additional use case exceptions (all use case has been handled), usually I add value-additional operations.

这些行动可以是通知(电子邮件/屏幕),历史数据维护,提醒,错误处理等一些操作可以是另一个用例一样,所以也许你会需要遍历到一号。

Those operations can be notification (email / on-screen), historical data maintenance, reminder, error-handling, etc. Some operations can be another use case as well, so maybe you will need to iterate over to no.1.

一些例子也许当你下支付结算过程中出现错误,也许你会需要另一个用例手工输入首付数据。或者,也许你将需要保持在另一个系统提醒系统。

Some example maybe when you get error during down payment settlement, maybe you will need another use case to input the down payment data manually. Or maybe you will need to maintain reminder system in another system.

转移到低级别车型

有关更多的信息,我通常使用状态图用​​例/功能,如订单状态。

For additional information, I usually use state diagram for use cases / functionality, such as order state.

低层次模型

低级别车型将解决由高级别较小的问题。说起来容易,你从高电平(也许订货)一个用例,并开始从它设计低的水平。而不是先定义的类图,我通常与某种形式的序列图的解决。下面是一些原因:

Low level model will tackle smaller problem from high level. Easily said, you take one use case from high level (maybe ordering) and begin designing low level from it. Rather than defining class diagram first, I usually tackle with some form of sequence diagram. Here is some reasons why:


  1. 序列为您提供有关获取输入,获得数据,并给予响应的并发视图

  2. 它提供了有关与其他系统,如数据库和互联网服务
  3. 关系好的图片
  4. 它可以给你约的切入点或接口的图片,其中可以为您的应用程序的基本体系结构
  5. 非常有用
  6. 您可以从它的基础类图和序列设计,而不是类图
  7. 中很容易找到的陷阱
  1. sequence gives you concurrency view about getting the input, getting data, and giving response
  2. It gives good picture about relations with other systems such as database and webservice
  3. It can give you pictures about entry point or interface, in which can be very useful for basic architecture of your apps
  4. You can base your class diagram from it and find pitfalls easily during sequence design rather than class diagram

然后我将继续系统状态图(可编辑,查看等)。

Then I will continue to system state diagram (editable, viewable, etc).

最后,我会继续数据库设计类图

为什么类图在最后一步?

类图(和数据库设计)是非常依赖于你的整个过程。如何并发发生,通知外系统的相互作用等可以影响接口和类图设计。这也符合你的codeBase的最近的设计。

Class diagram (and database design) is very dependent on your entire process. How concurrency occurs, notifications, outer system interactions, etc can affect the design of interfaces and class diagram. It is also the nearest design with your codebase.

希望这帮助,这完全是我的经验和看法。

Hope this help and this is entirely my experience and opinion.

这篇关于面向对象设计的问题,访谈的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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