IBM公司的面试题

这个模型设计得太糟糕。不如关灯看帽子颜色那个模型好。
 
最初由 Kent以东首帅哥 发布
明明一个人一天可以办完的事,却要50个人3天来完成, ......
That is so-called software engineering...
A project that a programer can do, but they need a VP, a project manager, 2 software engineers, 4 artchitects and a group of programmers, and finally the project failed only because there is only one stupid man in the team.
 
50

Logic to determine number of illed dogs:

Rule 1: IF (Is_ill[1]=false AND Is_ill[x2]=false AND ... AND Is_ill[x49])=false) THEN Kill_My_Dog RETURN True
because one guy is able to determine that his dog must be the only one ill dog. at this time count(Is_ill[i=1...n])=1

Rule 2: IF count(Is_ill[i=1...n]) > 1, no gun sound forever. because no one can determine his/her do is ill or not. information is insufficient.

Rule 3: Is_ill[x1] AND Is_ill[x2] ... AND Is_ill[x50] = TURE
because there must be at least one ill dog among 50 dogs. at this time, system will determine at least one ill do regardless any result of other rules.

If Rule 1 happened, at least one dog will be killed.
If Rule 2 happened, one dog will be killed;
If Rule 3 happened, 50 dogs are all ill. and <=50 dogs will be killed.(do care how many dogs will be killed, just tedermine 50 illed dogs.)
According to the conditions given for day 3, only Rule 3 happened.
 
sorry for the typo erros, here is the correction:

RESULT: 50 Illed dogs

Logic to determine number of illed dogs:

Rule 1: IF (Is_ill[1]=false AND Is_ill[x2]=false AND ... AND Is_ill[x49])=false) THEN Kill_My_Dog RETURN True
because one guy is able to determine that his dog must be the only one ill dog. at this time count(Is_ill[i=1...n])=1

Rule 2: IF count(Is_ill[i=1...n] > 1 AND count(Is_ill[i=1...n])<49 , no gun sound forever. because no one can determine his/her do is ill or not. information is insufficient.

Rule 3: Is_ill[x1] AND Is_ill[x2] ... AND Is_ill[x50] = TURE
because there must be at least one ill dog among 50 dogs. at this time, system will determine at least one ill dog regardless any result of other rules. If Rule 2 not happen, n must be 50.

If Rule 1 happened, at least one dog will be killed.
If Rule 2 happened, no dog will be killed;
If Rule 3 happened, 50 dogs are all ill. and <=50 dogs will be killed.(do care how many dogs will be killed, just tedermine 50 illed dogs.)
According to the conditions given for day 3, only Rule 3 happened.
 
最初由 午夜梦回 发布
不许观察自己的狗,也就是不许看了,不看怎么打得到啊

高见呀!也许是遥控杀狗。
 
Re: Re: IBM公司的面试题

最初由 靖哥哥 发布



我的答案是:病狗大于等于2只.
推理:
1.当病狗=1时,49人可以看见病狗,1人看不见,因为必需有1只病狗,则看不见病狗的主人杀自己的1只;
2.当病狗=2时,50人都可以看见病狗,则每个人在不交流的情况下,无法判断是否自己的狗有病,则一只都不能杀;
3.当病狗=3时,50人都可以看见病狗,则每个人在不交流的情况下,无法判断是否自己的狗有病,则一只都不能杀;
4.以此类推,......
5.因为必需有病狗,所以在经过三天的沉默之后,50个村民全部开枪打死了自己的狗.
6.这些村民不傻,但我想规定这个条件的人一定是个极端分子!如果给我一只枪,我一定先杀了这个出题的人.50只狗也许全部有病,但也可能仅有2只才有.
7.宁可错杀一千,绝不放过一个.这种超级强权政治,我们要推翻它!!!





:cool: :cool: :cool:
 
Sorry for off-topic, but Leo, regardless how challenge of the question, do you believe it is really an "IBM interview question? You mean in China, maybe?

Cause in North America, no one, let alone big company like IBM, will use dog as main character of this slaughtering story...

最初由 Leo2004 发布
村子中有50个人,每人有一条狗。在这50条狗中有病狗(这种病不会传染)。于是人们就要找出病狗。每个人可以观察其他的49条狗,以判断它们是否生病,只有自己的狗不能看。观察后得到的结果不得交流,也不能通知病狗的主人。主人一旦推算出自己家的是病狗就要枪毙自己的狗,而且每个人只有权利枪毙自己的狗,没有权利打死其他人的狗。第一天,第二天都没有枪响。到了第三天传来一阵枪声,问有几条病狗,如何推算得出?

50个人里面没有傻子,50条狗里面必须有病狗
 
最初由 Leo2004 发布
村子中有50个人,每人有一条狗。在这50条狗中有病狗(这种病不会传染)。于是人们就要找出病狗。每个人可以观察其他的49条狗,以判断它们是否生病,只有自己的狗不能看。观察后得到的结果不得交流,也不能通知病狗的主人。主人一旦推算出自己家的是病狗就要枪毙自己的狗,而且每个人只有权利枪毙自己的狗,没有权利打死其他人的狗。第一天,第二天都没有枪响。到了第三天传来一阵枪声,问有几条病狗,如何推算得出?

50个人里面没有傻子,50条狗里面必须有病狗


这个题最大的问题是这句:
“观察后得到的结果不得交流,也不能通知病狗的主人。”
因为这样就严重违反了Microsoft 或者 IBM 所强调的团队精神。

当然, 50个人里傻一点的会说有3只病狗。
 
最初由 悄悄的吧 发布


高见呀!也许是遥控杀狗。

要有中介组或检察组,来对50个执行者实行目标隔离和引导.

所以还不止50个人.
 
Re: Re: IBM公司的面试题

最初由 闲得慌 发布



这个题最大的问题是这句:
“观察后得到的结果不得交流,也不能通知病狗的主人。”
因为这样就严重违反了Microsoft 或者 IBM 所强调的团队精神。

当然, 50个人里傻一点的会说有3只病狗。

对一个简单的娱乐题目吹毛求疵,相信你不是50人中间的傻子,给一个答案吧!
 
后退
顶部