McAfee Interview Question: Puzzle about crossing a river... | Glassdoor

Interview Question

Software QA Engineer Interview Bengaluru (India)

Puzzle about crossing a river with time and combination of

  cannibals and normal humans conditions
Answer

Interview Answer

1 Answer

0

Solution to the River Crossing Puzzle:

To simply let us denote the entities involved as follows;

Let,
Anthropologist be A
Cannibal be C
The boat be B
Let us consider that everyone is on the west coast and let us denote it by W
The East coast is the part where everyone has to go and let us denote it by E

Step 1:
Let A and C cross with B So we have the following on each coast
W [A, A, C, C]
E [A, C, B]

Step 2:
A returns
W [A, A, A, C, C, B]
E [C]

Step 3:
Two C cross with B
W [A, A, A]
E [C, C, C, B]

Step 4: C returns
W [A, A, A, C, B]
E [C, C]

Dinesh on May 18, 2017

Add Answers or Comments

To comment on this, Sign In or Sign Up.