Surgeons

A one armed surgeon with a hand wound needs to operate on three patients. the surgeon only has two gloves. how can he operate on the three patients in turn without risking exchange of fluids? (remember he only has one arm so he only needs to wear one glove at a time.)


Solution

The surgeon places both gloves on his hand (1 and 2). he operates on patient A. he then takes the top glove off (#2), leaving on the bottom glove (#1) and operates on patient B. then he carefully reverses glove #2, so the clean side is on the outside, and he places it on top of glove #1 which is on his hand, and operates on patient C. this problem is kind of dumb because how’s the surgeon going to change the gloves on his hand when he only has one hand. plus no offense, but how often do you come across a one-armed surgeon (i’m sure there are plenty of one-armed doctors, but a surgeon!?!). anyway, i had to make this problem child friendly and changing the story to the above was the only way to do it. consider for a minute what the initial problem was. the surgeon was just a guy, the patients were women, and the glove was… well, i won’t insult your intelligence

2026 Update: Resource Sharing and Constraint Optimization

The Surgeons puzzle (three surgeons and one pair of gloves — how do they all operate safely with minimum gloves?) is a classic combinatorics puzzle about resource allocation under constraints. The answer: three surgeons can safely operate with just one pair of gloves through a carefully orchestrated sequence of inversions.

Why this is asked in 2026 tech interviews: The puzzle tests whether you can find creative solutions to resource constraint problems. This skill maps directly to:

  • Memory management: reusing buffer space safely in data pipelines
  • Connection pooling: sharing database connections across threads without contamination
  • API rate limiting: how to serve more clients than you have rate limit budget for, through careful scheduling

The solution structure: Surgeon 1 uses glove outer-side-A against patient. Glove is inverted. Surgeon 2 uses the now-inner-side-A (clean) against patient. Glove is placed over the first — allowing Surgeon 3 to use the outer clean side. Careful reading of which surfaces contact which is the key.

The interview takeaway: Great candidates first clarify assumptions (“what counts as contaminated?”), then systematically enumerate states, then propose the solution. Don’t jump to an answer — show the reasoning process.

Scroll to Top