thoughtworks Interview Category

In these problems, the expression (number in box X) is abbreviated as (X).

For example: “Is (4) greater than (7)?”
means “Is (number in box 4) greater than (number in box 7)?”

In each of the following problems, no two boxes contain the same number.

START

Is (3) greater than (1)?

NO YES Is (2) greater than (1)?

Is (2) greater than (1)? YES

NO YES NO
Is (3) greater than (2)?
Is (3) greater than (2)?

NO YES NO YES

Put the letter A
into box 4.


Put the letter B
into box 4.


Put the letter C
into box 4.


Put the letter D
into box 4.


Put the letter E
into box 4.


Put the letter F
into box 4.


END The letter A is now in box 4.

Which of the boxes 1, 2, 3 contains... the largest number?

the smallest number?

Read Solution (Total 1)

thoughtworks Other Question

The purpose of the following flow-chart is to double the number in each of the boxes: 13, 10, 7 and 4.

In order to accomplish exactly this -- no more and no less -- what is the smallest number which may be in box 14?


Box # 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15











START
>
1 Add: (number in box 13) + ( number in box 13), put result into box 13.

2 Change Instruction 1: Decrease all box-numbers mentioned in it, by 3.

NO 3 Is (number in box 14) greater than the second box-number mentioned in
Instruction 1?
YES

END What is the SMALLEST number which may be in box 14?