Pair Programming Peanut Butter and Jelly Sandwiches

written in Education, Pair Programming, Training

For this activity, pairs will work together to make a peanut butter and jelly sandwich. One person will give instructions on how to make the sandwich while the other is tasked with carrying out those instructions. The one giving instructions can not touch the ingredients or tools, and the one receiving instructions can not speak back.

When one half of the sandwich is complete (or when you deem it time), switch roles. When the sandwich is completely assembled, switch roles again and proceed to cut the sandwich in half.

For the Instruction Giver

When listing the steps in your procedure, you should assume the person following your instructions is as “dumb” as a computer (IE — someone unfamiliar with making a sandwich, like an alien from another planet.)

For the Instruction Receiver

When following the instructions, interpret them as literally as possible. Messes are acceptable (even expected!)


While a computer has no “common sense” that would allow it to correctly guess your intent, we can assume a certain knowledge of these basic actions:

  • open any container
  • close any container
  • hold a thing
  • pick up a thing
  • put a thing down
  • spread a condiment

What we’re missing is timing, amounts, and other interactive qualities. For example, we can say “spread the jelly” and assume the Receiver knows how to work their muscles, but will continue to “spread the jelly” all over everything within arms reach unless or until given a condition to cease.


  • explore pair communication skills
  • expose communication assumptions
  • practice expressing commands in an explicit manner

Extending The Exercise

  • blindfold the Receiver, such that the Instruction Giver has to be more explicit with positional information and conditional checking
  • have the Instruction Giver stand with their back to the Receiver, so that they can not see the sandwich being assembled
  • have an instructor act as a Product Owner, who can be questioned about any aspect of the sandwich making process, and who can reject the sandwich for any of the following:
    • wrong kind of
      • peanut butter
      • jelly
      • bread
    • incorrectly cut
    • insufficient amount of condiment
    • overabundance of condiment

comments powered by Disqus