# Interview Question: How will the gold coins be divided in the end?

The facts of the question: Five pirates looted a chest full of 100 gold coins. Being a bunch of democratic pirates, they agree on the following method to divide the loot: The most senior pirate will propose a distribution of the coins. All pirates, including the most senior pirate, will then vote. If at least 50% of the pirates (3 pirates in this case) accept the proposal, the gold is divided as proposed. If not, the most senior pirate will be fed to shark and the process starts over with the next most senior pirate… The process is repeated until a plan is approved.

You can assume that all pirates are perfectly rational:

1. They want to stay alive and
2. Get as much gold as possible second.
3. Finally, being blood-thirsty pirates, they want to have fewer pirates on the boat if given a choice between otherwise equal outcomes.

How will the gold coins be divided in the end?

## Strategy and Approach to Answering a Problem Solving Interview Question

If you get asked a problem solving question in an interview, remember that they are NOT looking for the RIGHT answer. They are evaluating the approach you use to think out and solve the problem. A strong candidate demonstrates the following:

1. Evaluates and understand the scope of the problem
2. Communicates assumptions
3. Demonstrates quantitative analytical skills
4. Answers the question that has been asked. You’d be surprised how many candidates get lost in the analysis and solve for a different question than what was asked.

## How to Answer this Problem Solving (aka Microsoft or Google) Interview Question

This problem solving interview question is a classic example of game theory. In thinking this out, let’s start with a simplified version of the problem by reducing the number of pirates.

Since the solution to 1-pirate case is trivial, let’s start with 2 pirates. The senior pirate (labeled as 2) can claim all the gold since he will always get 50% of the votes from himself and pirate 1 is left with nothing. Let’s add a more senior pirate, 3. He knows that if his plan is voted down, pirate 1 will get nothing.  But if he offers private 1 nothing, pirate 1 will be happy to kill him. So pirate 3 will offer pirate 1 one coin and keep the remaining 99 coins, in which the plan will have 2 votes from pirate 1 and 3. If pirate 4 is added, he knows that if his plan is voted down, pirate 2 will get nothing. So pirate 2 will settle for one coin if pirate 4 offers one.  So pirate 4 should offer pirate 2 one coin and keep the remaining 99 coins and his plan will be approved with 50% of the votes from pirate 2 and 4.

Now we finally come to the 5-pirate case. He knows that if his plan is voted down, both pirate 3 and pirate 1 will get nothing. So he only needs to offer pirate 1 and pirate 3 one coin each to get their votes and keep the remaining 98 coins. If he divides the coins this way, he will have three out of the five votes: from pirates 1 and 3 as well as himself.

Once we start with a simplified version and add complexity to it, the answer becomes obvious. Actually after the case n=5, a clear pattern has emerged and we do not need to stop at 5 pirates. For any 2n-1 pirate case (n should be less than 99 though), the most senior pirate will offer pirates 1, 3, …. , and 2n-1 each one coin and keep the rest for himself.

Note: For this problem solving job interview question, there is an actual logical answer, however the interviewer will want to evaluate your thinking process. In answering the interview question, the lead up to your answer will be just as important as the actual answer itself.

For more problem solving, brain teasers, riddles, puzzles, logic job interview questions, please check our out Problem Solving Interview Section.