The Gold Bar Puzzle
The Puzzle: You hired an employee for 7 days. You have a gold bar of 7 segments.
- You must pay them exactly 1 segment every day.
- You are allowed to make only two cuts to the bar. How do you do it?
1. The Strategy
Think of binary numbers. To represent any number from 1 to 7, you need the powers of 2: 1, 2, and 4.
- The Cuts: Cut the 7-segment bar into three pieces:
- Piece 1: 1 segment.
- Piece 2: 2 segments.
- Piece 3: 4 segments.
- (Wait, how? Just one cut to get 1 segment, another cut to get 2 segments. The remaining part is 4).
2. The Daily Payment (The “Change” System)
- Day 1: Give 1.
- Day 2: Give 2, take back 1. (Employee has 2).
- Day 3: Give 1. (Employee has 1 + 2 = 3).
- Day 4: Give 4, take back 1 and 2. (Employee has 4).
- Day 5: Give 1. (Employee has 1 + 4 = 5).
- Day 6: Give 2, take back 1. (Employee has 2 + 4 = 6).
- Day 7: Give 1. (Employee has 1 + 2 + 4 = 7).
Interview-Focused Questions
Q: How is this related to computer science?
A: This is exactly how binary counting works. Every integer can be uniquely represented as a sum of powers of 2. By having pieces of size 1, 2, and 4, you can create any combination from 1 to 7.
Q: How many cuts would you need for 31 days?
A: To represent 1 to 31, you need 1,2,4,8,16. That’s 5 pieces. You would need 4 cuts to create 5 pieces.
Key Takeaway
This puzzle is about state transition. You don’t just “give” payment; you can “exchange” pieces to reach the desired state.
Premium Content
Unlock Gold Bar Puzzle and all premium lessons with a subscription.
All premium lessons
Ad-free experience
Priority support
From ₹199.99/year — See plans