面试例题1:如下表,10个盒子,分别装一些数字。[美国体育网络A公司2008年逻辑测试题]
Box# 1 2 3 4 5 6 7 8 9 10
6 |
3 |
9 |
2 |
11 |
2 |
91 |
48 |
66 |
1 |
Add: (number in box 4) + (number in box 2) , put result into box 7.
(盒4数+盒2数之和置于盒7)
Add: (number in box 7) + (number in the box whose number is in box 6) , put result into box 6.(盒7数+盒号为盒6数的数之和置于盒6)
Multiply: (number in box 6) * (number in the box 1) put result into box 5.
(盒6数×盒号为盒6数的数之积置于盒5中)
What number is now in box 5? (盒5中数是多少)
解析:流程步骤如下:
(1)盒4数+盒2数之和置于盒7,即2+3=5,盒7数现在为5。
(2)盒7数为5,盒6数为2,盒2数为3。盒7数+盒2数之和置于盒6,即5+3=8,盒6数现在为8。
(3)盒6数为8,盒1数为6,盒6数×盒1数之积置于盒5,即6×8=48,盒5数现在为48。
答案:48。
面试例题2:如下表,8个盒子,分别装一些数字。[美国体育网络A公司2008年逻辑测试题]
Box# 1 2 3 4 5 6 7 8
3 |
7 |
2 |
1 |
5 |
12 |
4 |
0 |
Put: (number in box 8) into box 1. (盒8数置于盒1)
Add: (number in box 1) + (number in the box2) , put result into box 1.
(盒1数+盒2数之和置于盒1)
Change Instruction 2: Increase the second box-number mentioned in it, by 1.
(改变步骤 2:提高第二个提及的盒号码+1)
Is The second box number mentioned in Instruction 2, greater than (number in box 7)?(步骤2中第二个提及的盒号码>盒7数)
What number is now in box 1? (盒1数为多少?)
解析:流程步骤如下:
(1)盒8数置于盒1,盒8数为0,所以盒1数为0。
(2)盒1数+盒2数之和置于盒1,即0+7=7,盒1数现在为7。
(3)改变步骤 2:提高第二个提及的盒号码+1,第二个提及的盒号码为盒2,现在改为盒3。
(4)看第二个提及的盒号码是否大于盒7数,盒7数字为4,盒号码3还不大于盒7数。
(5)盒1数+盒3数之和置于盒1,即7+2=9,盒1数现在为9。
(6)改变步骤 2:提高第二个提及的盒号码+1,第二个提及的盒号码为盒3,现在改为盒4。
(7)看第二个提及的盒号码是否大于盒7数,盒7数字为4,盒号码4还不大于盒7数。
(8)盒1数+盒4数之和置于盒1,即9+1=10,盒1数现在为10。
(9)改变步骤 2:提高第二个提及的盒号码+1,第二个提及的盒号码为盒4,现在改为盒5。
(10)看第二个提及的盒号码是否大于盒7数,盒7数字为4,盒号码5大于盒7数。
答案:10。
面试例题3:如下表,12个盒子,分别装一些数字。[美国体育网络A公司2008年逻辑测试题]
Box 1 2 3 4 5 6 7 8 9 10 11 12
2 |
11 |
-9 |
3 |
-2 |
12 |
4 |
9 |
6 |
3 |
1 |
4 |
Substract: (number in box 10) -1, put result into box 10.(盒10数-1后置于盒10)
Put (number in box 9) into box 1.(盒9数置于盒1)
Is the first box-number mentioned in Instruction 2, an even number?(在Instruction 2提及的第一个盒号码是偶数吗?)
Take as your next instruction, the one whose number is in the box whose number is in box 8.(将下面这个作为步骤:步骤数为盒号码为盒8数的数。)
Change Instruction 2: Decrease the first box-number mentioned in it, by 1.(改变步骤2:将第一个提及的盒号码-1)
Add: (number in box 10) + (number in the box 4) , put result into box 10. (盒10数+盒4数后置于盒10)
Change Instruction 2: Decrease the first box-number mentioned in it, by 1. And increase the second box-number mentioned in it, by number in box 11. (改变步骤 2:将第1个提及的盒号码-1,将第2个提及的盒号码+盒11数)
Is the last box-number mentioned in Instruction 2, equal to (number in box 12) ? (步骤2中最后一个提及的盒号码=盒12数?)
Take as your next Instruction, the one before Instruction 3. (将下面这个作为步骤:步骤数为步骤3前的那个。
What number is now in? Box 3? _____
Box 10?_____
解析:流程步骤如下:
(1)盒10数-1置于盒10,盒10数原为3,所以盒10数为2。
(2)盒9数置于盒1,盒1数现在为6;
(3)步骤 2中提到的第一个盒号码是偶数吗?步骤 2中提到的第一个盒号码是盒9,非偶数。
(4)因为非偶数执行步骤4,步骤数为盒号码为盒8数的数。盒8数为9,盒9数为6。也是执行步骤6,步骤6是将盒10数+盒4数后置于盒10;盒10数为2,盒4数为3,累加后盒10数为5。
(5)改变步骤2:将第一次提到的盒号码减1;步骤2第一次提到的盒号码9-1为盒8。
(6)盒10数+盒4数后置于盒10;盒10数为5,盒4数为3,累加后盒10数为8。
(7)改变步骤 2:将第1个提及的盒号码-1,步骤2第一次提到的盒号码8-1为盒7。将第2个提及的盒号码+盒11数。步骤2第2次提到的盒号码1+盒11数1=盒2。
(8)看步骤2中最后一个提及的盒号码=盒12数?步骤2中最后一个提及的盒号码为盒2,盒12数为4。故两者不等。
(9)将下面这个作为步骤:步骤数为步骤3前的那个。即执行步骤2:盒7数置于盒2。
答案:盒3没有变动,仍为-9。盒10为8。
面试例题4:The object of the following flow-chart is to rearrange in boxes 1,2 and 3 in such a fashion that, at the end:(该流程图的目标是重组盒1,2,3以达到如下目标)[美国体育网络A公司2008年逻辑测试题]
Box 3 will always contain the largest mumber. (盒3数最大)
Box 1 will always contain the smallest mumber. (盒1数最小)
However, this flow-chart is INCORRECT, and it stands, it will not accomplish the desired purpose.(然而,此流程图并不正确,如果按此算法,将无法达到目的)
Which one instruction must be changed to correct the flow-chart.(哪一个指令必须修正才能达到目标)
Is (Number in box 1) less than (Number in box 2)?(盒1数<盒2数?)
Put (number in box 1) into box 4.(盒1数置于盒4)
Put (number in box 2) into box 1.(盒2数置于盒1)
Put (number in box 4) into box 2 .(盒4数置于盒2)
Is (Number in box 3) less than (Number in box 2)? (盒3数<盒2数?)
Put (number in box 2) into box 4.(盒2数置于盒4)
Put (number in box 3) into box 2.(盒3数置于盒2)
Put (number in box 4) into box 3.(盒4数置于盒3)
解析:如果对逻辑程序比较熟悉,可以看到问题出现在Instruction 5,因为如果盒3数<盒2数就直接End,盒3数就不可能最大了。
本题实际上分为两块,Instruction 2,3,4作为一块,用来计算盒1,盒2中较小的数,并交换位置,盒4的用处是作为中转空间;Instruction 6,7,8作为一块,用来计算盒2,盒3中较大的数,并交换位置,盒4的用处是作为中转空间。只要保证盒1<盒2,且盒2<盒3,就能满足题意。
答案: 将 Instruction 5的Is (Number in box 3) less than (Number in box 2)?修改为Is (Number in box 3) more than (Number in box 2).
面试例题5:This following flow-chart(如下图):[美国体育网络A公司2008年逻辑测试题]
Either the letter B or the letter E in box 4.(在盒4中只可能是B或E)
Which of the boxes 1,2,3 Cannot possibly contain the largest number _______(盒1,2,3不可能包含最大的数),the smallest number ______.(盒1,2,3不可能包含最小的数)
解析:如果盒4中为B,则反推条件,可以得出(2)>(1)>(3);如果盒4中为E,则反推条件,可以得出(3)> (2) > (1);所以(1)不可能最大,(2)不可能最小。
答案:(1)(2)。
面试例题6:The purpose of the following flow-chart is to add up the numbers in boxes 3,4,5,6,9,10 and 11, and to put the total to box 7.(流程图的目的是加盒子3,4,5,6,9,10和11里面数字之和,然后把结果放到盒7中)
In order to accomplish exactly this-no more and no less -what number must be in box 2?(为了达到以上的目的,盒2应该放什么数)[美国体育网络A公司2008年逻辑测试题]
1 2 3 4 5 6 7 8 9 10 11 12 13
Put a zero into box 7.(盒7置0)
Add: (number in box 7) + (number in box 3), put result into box 7.(盒7数+盒3数之和置于盒7)
Is the second box-number mentioned in Instruction 2, less than (number in box 2)?( Instruction 2中第二个提到的盒号码<盒2数)
Add:(number in box 11) + (number in box 7). Put result into box 7.(盒11数+盒7数之和置于盒7)
Change Instruction 2: Increase the second box-number mentioned in it, by 1.(改变Instruction 2中第二个提到的盒号码+1)
Change Instruction 4:Decrease the first box- number mentioned in it, by 1.(改变Instruction 4中第一个提到的盒号码-1)
What number must be in box 2?______________(盒2中数必为多少?)
解析:首先要搞清楚两个概念:box-number和number in box;前者是盒的号码数:盒1,盒2,盒3,…而后者是盒中的数字。
本题考的是数字的累加,在Instruction 2先添加了盒3数,在Instruction 4再添加了盒11数。然后在Instruction 5,Instruction 6中分别给Instruction 2,Instruction 4改变了要添加的盒数。Instruction 5增加了盒号,Instruction 6减少了盒号,所以本题完整的添加顺序是:
(7) = 0;
(7) = (7) + (3);
(7) = (7) + (11);
(7) = (7) + (4);
(7) = (7) + (10);
(7) = (7) + (5);
(7) = (7) + (9);
(7) = (7) + (6);
(7) = (7) + (8);
所以盒2中的数只有为7,才能正好满足条件。
答案:7。