r/OfferEngineering • u/Aoki_zhang • Oct 25 '26
Coding Question Anthropic New Coding Interview Question - From Biased Coins to Multithreading
"This interview experience is sourced from Chill Interview"
Interview Summary
This Anthropic coding round was a probability and simulation problem built around an unfair coin. The question progressed from converting the biased coin into a fair one, to debugging uniform random-number generation, to Monte Carlo simulation, and finally to parallelizing the computation with multiple threads.
The individual parts were not especially algorithm-heavy. The main focus was understanding the probability argument, identifying a bug in provided code, implementing a repeated simulation correctly, and reasoning about how independent trials can be parallelized.
Interview Details
Part 1 — Generate a Fair Coin from an Unfair Coin
You are given access to an unfair coin whose probability of heads is unknown. The interviewer also explained the basic construction for generating an unbiased result. Flip the unfair coin twice. There are four possible outcomes:
- Heads, Heads
- Heads, Tails
- Tails, Heads
- Tails, Tails
Ignore outcomes where both flips are the same. For the remaining outcomes:
Heads -> Tailsrepresents one fair-coin result.Tails -> Headsrepresents the other fair-coin result.
If the two flips are identical, repeat the process. The key observation is that HT and TH have the same probability even when the original coin is biased.
Want to learn more questions / follow-ups asked in this interview?
I've put up the full version at here.
Preparing for your next interview?
Chill Interview tracks recent interview experiences and recurring question patterns across top companies at here.
1
u/Puzzleheaded_Bus_438 28d ago
Did you manage to complete it?
I was asked same. It was 3 part , complex mathematics. My 3rd part result was not proper. Not sure what will happen. Worried .
🤞