The camel and 3,000 bananas

product-puzzle case · difficulty 4/5 · 15 minutes · other

Prompt

A camel has 3,000 bananas and needs to cross a 1,000-mile desert to reach the market. It can carry at most 1,000 bananas at a time and eats one banana for every mile it walks. What is the largest number of bananas it can bring to the market?

Context

A classic interview puzzle. Core idea: Optimizing cache points (miles 200 and 533) to maximize forward transport. Talk through your reasoning; the interviewer cares as much about structure as about the answer.

Clarifying questions

Can it drop bananas?
Yes, it can drop bananas anywhere and return to the start, always eating one banana per mile walked, and it can carry at most 1,000 at a time.

Recommendation

**Answer:** About 533 bananas (533 1/3 if the distances can be fractions of a mile). Caches at mile 200 and mile 533. **Why:** Each stage reduces the number of loads by one, so the camel only pays the expensive 5-bananas-per-mile rate for as short a distance as possible.

Risks

Next steps