PREPARE FOR A TECHNICAL INTERVIEW

Question: You’ve got someone working for you for seven days and a gold bar to pay them. You must pay the worker for their work at the end of every day. If you are only allowed to make two breaks in the gold bar, how do you pay your worker? (Assuming equal amount of work is done during each day thus requiring equal amount of pay for each day)

Answer: The trick is not to try and how to cut in such a way to make 7 equal pieces but rather to make transactions with the worker. Make two cuts on the gold bar such that you have the following sizes of bars.

1/7, 2/7 and 4/7. For convenience sake, I would just refer to the bars as 1, 2 and 4.

At the end of Day 1: Give Bar 1 (You- 2 and 4, Worker- 1)

At the end of Day 2: Give Bar 2, Take back Bar 1 (You- 1 and 4, Worker- 2)

At the end of Day 3: Give Bar 1 (You- 4, Worker- 1 and 2)

At the end of Day 4: Give Bar 4, Take back Bar 1 and Bar 2 (You- 1 and 2, Worker- 4)

At the end of Day 5: Give Bar 1 (You- 2, Worker- 1 and 4)

At the end of Day 6: Give Bar 2, Take back Bar 1 (You- 1, Worker- 2 and 4)

Continue Reading Below

At the end of Day 7: Give Bar 1 (You- Empty, Worker- 1, 2 and 4)

That should take care of everything.

If you have any questions, please feel free to send me an email at support@mytechinterviews.com. If you have any interview questions which you feel would benefit others, I would love to hear about it.

11 Responses

@schimoschone actually there is a purpose to paying every day even if the worker can’t spend it: what if the worker doesn’t need to be paid every day to support their needs, but neither the worker nor the employer trust each other to follow through on their end of the bargain? If the employer only pays the worker after all 7 days and then doesn’t pay up, then the worker loses 7 days of productivity and gets nothing. If the employer pays the employee upfront and the employee runs off with it and doesn’t work, then the employer loses 7 days of payment and gets nothing. If the worker gets paid every day, then as soon as the employer fails to pay up, the worker can quit and they only lose one day of labor. At the same time, the employer never risks paying for work that isn’t done.

(Of course, the game theory of this situation might get complicated on the last day, since the work is complete and the employer no longer has incentive to pay, and if both employer and worker are rational then the worker should refuse to work on the last day, and by backwards induction the worker should refuse to work on the first day so no work gets done and no payment is given.)

While there is possibly some merit in asking the question.. you know, see if an employee has a creative response to a bad situation.. the answer that appears to be wanted is just plain daft.

I mean, what’s the point of paying an employee if your plan is to barter some amount of what you paid them back at some future point. Employees take payment for their services so that they can in turn buy the goods and services they need to survive.. and thus keep working for your scrooged ass. The only reason one would pay an employee prior to completing their work would be to support their needs prior to completion. If the employee can’t spend the money because I will later have to trade it back to them, then we’ve negated the whole reason for the trade.

That stated then, there’s three real answers: First, pay them upon completion. Second pay them one block approximately every 3rd of a week. Or third, pay them some initial good-faith amount with the rest upon completion.

Yes, while I realize this poses a mathematical problem begging for an efficient answer, as part of an interview for anything other than a math specific position it shows a complete lack of grounding in reality. Do really want to hire someone who is so grounded in efficiency that they’ll never actually be able to negotiate a strategy with another human being by accounting for that persons needs?

Who would answer it this way? I don’t see why anyone would think about taking money back from someone you pay? You can’t count on the money being there on day 2, 3, etc. People have a habit of spending money.