Skip to content
Daily Puzzle · Logic

Two guards, two doors, one question.

The two guards puzzle: one door leads out, one guard always lies, one always tells the truth, and you do not know which is which. You get a single question. The famous answer works because it routes the question through both guards at once.

Posted · 8 Sept 2026Logiceasy4 min

You stand before two doors. One leads to freedom, the other does not, and they look identical. Each door has a guard. One guard always tells the truth; the other always lies. Both guards know which door is which, and both know which of them is the liar. You do not know either fact.

You may ask exactly one question, to exactly one guard, and it must be answerable with a single word. Then you must choose a door.

What question guarantees you pick the door to freedom?

The obvious attempt, "which door leads out?", fails: you get a truthful answer or a lie and cannot tell which. A less obvious attempt, asking a factual question you already know the answer to ("is the sky blue?") identifies the liar, but spends your only question doing it. The puzzle is asking for a single question whose answer is reliable no matter which guard you happened to pick. Think about how to make the liar's lie cancel itself out.

Stuck? Open hints one at a time

Each hint gives away one more layer. Stop the moment something clicks.

Hint 1 a nudge

A lie about a lie is the truth. If you can force the liar to lie twice within one answer, and the truth-teller to tell the truth twice, both give the same output.

Hint 2 the key move

Ask one guard about what the other guard would say. Each answer then passes through both a truth and a lie, in some order, and the result is always inverted.

The solution

Reveal the full solution

Point at one door and ask either guard: "If I asked the other guard whether this door leads to freedom, would he say yes?" Then do the opposite of the answer.

Trace both cases. Suppose the door you pointed at is the way out. If you asked the truth-teller, he truthfully reports that the liar would say "no". If you asked the liar, he lies about the truth-teller's "yes" and also says "no". Either way you hear "no" for the correct door, and by the mirror argument you hear "yes" for the wrong one. The answer is always inverted, so "do the opposite" is a reliable decoding rule that never depends on knowing whom you asked.

A second question works with the same structure, and some interviewers prefer it: "If I asked you whether this door leads to freedom, would you say yes?" The truth-teller answers honestly about his honest answer. The liar would lie about the door, and then lies about that lie, and the double negation gives the true answer. This version is not inverted, so you follow it directly. Both questions work by composing two guards' behaviours, or one guard's behaviour with itself, so that a lie is always paired with a second lie.

What this puzzle is really testing

Whether you can design an operation whose output is invariant under an unknown transformation. You do not know if your channel is the identity or a negation, so you build a question that applies the channel twice, since negation composed with itself is the identity. That is exactly the move in the blindfolded coins puzzle, where flipping cancels an unknown count, and it is the reasoning behind checksums and parity bits: pair the unknown corruption with a known structure so that it cancels. The habit of writing out a truth table for every case rather than trusting a hunch is the small-scale version of proving by cases.

Follow-ups to expect

Three guards, where one answers randomly: this is the "hardest logic puzzle ever" and needs three questions with careful nesting. The variant where the guards answer in a language where you do not know which of two words means yes: still solvable, by asking a question whose answer word is the same regardless of meaning. And the simplest cousin: a single guard of unknown type, where the self-referential version of the question is the one that works.