Interview Prep

Wolf Goat Cabbage Puzzle Answer [Solved]

Wolf goat cabbage puzzle answer: farmer, wolf, goat and cabbage at a river crossing

Answer: the wolf goat cabbage puzzle takes 7 trips. Take the goat across first, bring the goat back once in the middle, and take the goat across last.

The wolf goat cabbage puzzle is a classic river crossing test. A farmer must move a wolf, a goat, and a cabbage across a river in a small boat. The boat holds the farmer plus one item only. The puzzle feels impossible at first, because every obvious first move loses something. The trick is not speed. It is planning the whole sequence before the first crossing, and accepting one step backwards in the middle.

The Puzzle

Picture two riverbanks. On the starting bank stand the farmer, the wolf, the goat, and the cabbage. The goal is to move all three items to the far bank, safe and uneaten. The boat carries the farmer and one item at a time. If the wolf and the goat are left alone together, the wolf eats the goat. If the goat and the cabbage are left alone together, the goat eats the cabbage. The wolf ignores the cabbage, so those two can share a bank safely. While the farmer is present, nothing gets eaten, so danger only starts when the farmer leaves a risky pair alone. After every trip, check both banks.

Wolf Goat Cabbage Puzzle: The 7 Trip Solution

Start with the goat, because the goat is the troublemaker. The goat is the only item that threatens another item and is also threatened by another item. Move the goat first, and the wolf and the cabbage stay behind together. That pair is safe, which is the whole key to the puzzle.

Trip Farmer crosses with Left bank after Right bank after Why it is safe
1 Goat, left to right Wolf, cabbage Goat Wolf ignores cabbage
2 Nothing, right to left Wolf, cabbage Goat alone One item alone is safe
3 Wolf, left to right Cabbage alone Wolf, goat Farmer is present, so no eating
4 Goat, right to left Goat, cabbage Wolf alone Farmer is present on the left; wolf sits alone on the right
5 Cabbage, left to right Goat alone Wolf, cabbage Wolf ignores cabbage
6 Nothing, right to left Goat alone Wolf, cabbage Wolf ignores cabbage
7 Goat, left to right Empty Wolf, goat, cabbage All three are across, farmer present

The swap back is the whole puzzle

Trip 4 is the move most candidates resist. The farmer has just carried the goat across, and now the farmer carries it straight back. That feels like wasted effort. In fact it is the only move that saves the puzzle. Without it, the goat would stay on the far bank with either the wolf or the cabbage, and the farmer would lose one item on the next trip.

Check every bank after every trip

Use this habit in the interview room. After each trip, name the pairs left alone on each bank. One item alone is safe, and the wolf with the cabbage is safe. Any other pair means the plan has already failed.

Why Most First Attempts Fail

Try the wolf first, and the puzzle ends at once. The farmer leaves with the wolf, and the goat and the cabbage sit alone on the starting bank. The goat eats the cabbage before the farmer reaches the far bank. So the wolf cannot go first.

Try the cabbage first, and the same problem appears in reverse. The farmer leaves with the cabbage, and the wolf and the goat sit alone on the starting bank. The wolf eats the goat. So the cabbage cannot go first either. Only the goat can go first, because the pair left behind is the one safe pair in the puzzle.

Try the goat first and then the wolf, and many candidates stop thinking there. The farmer takes the goat across, returns alone, and takes the wolf across. Then the farmer returns alone for the cabbage, and the wolf eats the goat on the far bank. The error is not the wolf trip. The error is leaving the goat with the wolf. Bring the goat back on trip 4, and the puzzle opens up.

Why the Wolf Goat Cabbage Puzzle Has Only Two Short Solutions

The goat must cross three times: first, because only the goat can go first; second, back across, because the goat cannot sit alone with the wolf or the cabbage while the farmer fetches the third item; and third, last, after the wolf and the cabbage are safe together on the far bank. The wolf and the cabbage cross once each, giving five loaded trips in total.

Between those five loaded trips, the farmer needs two empty returns. Five loaded trips plus two empty returns make seven trips, matching the table above. No shorter sequence exists.

Swap the middle items, and you get the second short solution. Take the goat first, return alone, take the cabbage across, bring the goat back, take the wolf across, return alone, and take the goat across last. The structure is identical. Only the order of the wolf and the cabbage changes. Longer solutions exist if you add pointless extra trips, but no solution beats seven trips.

What Changes When the Boat Gets Bigger

Interviewers love a follow up that changes one rule. Suppose the boat holds the farmer plus two items. Then the puzzle collapses to three trips. Take the wolf and the cabbage across together, return alone, and take the goat across last. The wolf and the cabbage sit safely together while the farmer returns, and the goat joins them at the end. The hard part of the puzzle was never the river. It was the one item limit.

Rename the items, and the puzzle stays the same. Fox, chicken, and grain is the same puzzle with new labels. The chicken plays the goat role, because the fox threatens the chicken and the chicken threatens the grain. Spot the middle item in any version, move it first, swap it back once, and the same seven trip pattern solves it.

What the Interviewer Is Testing in the Wolf Goat Cabbage Puzzle

First, the interviewer tests planning over reacting. A candidate who moves the first item that comes to mind fails on trip 1. A strong candidate names the safe pair before moving anything, and then builds the sequence around it.

Second, the interviewer tests state tracking. You must hold two banks in your head at once, and update both after every trip. Candidates who track only the boat forget the bank they just left.

Third, the interviewer tests comfort with a backward step. Trip 4 looks like failure, because the goat goes back where it started. Strong candidates explain why it helps before they make it.

Finally, the interviewer tests clear talk. Say each trip out loud, name the pairs left alone, and state the check. If you can explain trip 4 in one sentence, you sound like someone who solved the puzzle, not someone who memorised it.

Try Another Puzzle

Keep the streak going. Try the Birthday Paradox Answer: 23 People (23 people beat even odds), the Missing Dollar Riddle Answer: No Dollar Lost (a false sum hides a double count), and the Bridge and Torch Puzzle Answer: Cross in 17 Minutes (the slowest walker sets the pace).

Wolf Goat Cabbage Puzzle: Quick Answers

Can the farmer take the wolf first?

No. Taking the wolf first leaves the goat and the cabbage alone on the starting bank, and the goat eats the cabbage. The same failure hits the cabbage first, because the wolf and the goat are left alone together. Only the goat can go first.

Does the order of the wolf and the cabbage matter?

No, as long as the goat swap stays in the middle. Wolf second and cabbage third works, and cabbage second and wolf third works. Both versions take seven trips, and both end with the goat crossing last.

Is 7 trips really the minimum?

Yes. The goat needs three crossings, the wolf needs one, and the cabbage needs one, which makes five loaded trips. The farmer needs two empty returns between them, which makes seven trips in total. Any plan with fewer trips skips a crossing or a return that the rules require.

Source note: this puzzle was reported as a Concerto Software interview question on Glassdoor. The walkthrough, the table, the failure traces, and the minimum trip proof above are original to this post.

Leave a Reply

Your email address will not be published. Required fields are marked *