logic puzzles

Screwy Pirates

A. first i would just like to say i am so glad jenna got voted off survivor. yuck, i couldn’t stand her ever since she accused that guy of eating beef jerky when he was chewing on grass.

B. recruit meyer on boot camp rocks. did you see how he made himself cry to get sympathy? and it worked! he is the funniest part of the show. i hope he wins.

C. i apologize for this site being soooooo slow. but that’s why you get what you pay for. (i didn’t pay anything so i shouldn’t really expect anything in return.)

D. those screwy pirates are at it again. this time there are 13 pirates and they need to protect their treasure chest. they decide that they should only be able to open the chest if the majority (at least 7) agree that it should be opened. they ask a locksmith to come and put a specific number of locks on the safe. every lock must be opened to open the chest. there can be multiple keys for each lock, but each key only opens one lock (i.e. no skeleton keys). the locksmith can give more than one key to each pirate. how many locks should the locksmith use and what strategy should he use to distribute the keys, such that only when a majority of the pirates agree can the chest be opened?

Solution

Problem: those screwy pirates are at it again. this time there are 13 pirates and they need to protect their treasure chest. they decide that they should only be able to open the chest if the majority (at least 7) agree that it should be opened. they ask a locksmith to come and put a specific number of locks on the safe. every lock must be opened to open the chest. there can be multiple keys for each lock, but each key only opens one lock (i.e. no skeleton keys). the locksmith can give more than one key to each pirate. how many locks should the locksmith use and what strategy should he use to distribute the keys, such that only when a majority of the pirates agree can the chest be opened?

a somewhat technical answer is here.

(un)fortunately that user left it up to me to explain why this solution works… but fortunately my brother did it here in a very understandable fashion. thanks big brother!

2026 Update: Game Theory Puzzles in Tech Interviews

The Screwy Pirates puzzle (also known as the Pirate Game) is a classic game theory / backward induction problem. It remains asked at quant firms, Google, and fintech companies as a test of strategic reasoning.

The core insight: Solve it backward from the simplest case (2 pirates) and build up. This backward induction technique is directly applicable to real engineering decisions: pricing strategies, auction design, and distributed consensus protocols all use backward induction reasoning.

What’s changed in 2026: Interviewers at AI companies now ask variants involving LLM agents negotiating or multi-agent game theory scenarios — the pirate game logic applies directly to mechanism design for AI systems.

How AI tools changed the problem: Because the standard answer is widely known, interviewers extend with: “What if pirates vote sequentially rather than simultaneously?” or “What if a pirate can bribe others before the vote?” These require fresh reasoning, not recall.

Still asked at (2026): Jane Street, Two Sigma, DE Shaw, Google (program manager and product roles), strategy consulting.

newsletter

What's actually being asked right now

Interview patterns & comp trends, straight to your inbox.

No spam. Unsubscribe anytime.

newsletter

What's actually being asked right now

Interview patterns & comp trends, straight to your inbox.

No spam. Unsubscribe anytime.

1972 Soviet postage stamp commemorating the Mars 2 probe

worth a read

Mars For The Rest of Us — a weekly-or-more deep dive on the technical side of Mars exploration: rocket propulsion, microbiology, mission architecture, and everything in between. Written by Maciej Ceglowski.

Read it on Substack →
Scroll to Top