Getting paid for seven days with a single bar of gold

An employer hires you to work for 7 days and has a gold bar with 7 segments to pay you with. How do you get them to not break it to pieces?


Problem Statement

Someone hires you to do equal days of work for them for seven days in a row. You don't necessarily trust this guy to owe you wages, so you want to be paid for the work you did everyday. He happens to have a gold bar with seven equal segments on it, each worth a day of your wages. He offers to break off one segment and give it to you each day. But you know that smaller pieces of gold are less likely to appreciate in value over time. What should you tell him to do?

No, he doesn't have cash. No you can't trust him to give the whole bar to you in the end.


Evaluation

Did you manage to get paid without breaking down the gold bar more than twice? (100%)


Solution

Note that if you use any hints, you lose the grade. So don't look. But if you have to, here they are:


Hint 1

Seven is a very nice number in binary.


Hint 2

Can you solve it by breaking the bar only twice?


Hint 3

7 = 4 + 2 + 1


References

Microsoft recruiters used to ask this from Product Managers and Software Engineers in early stages of the screening

Amin A.

Written by

Amin Ariana

A software entrepreneur from San Francisco