← Coinbase Interview Insights

Coinbase·Data Scientist·Technical Phone Screen·Senior

Senior
May 2026

Summary

Coinbase data scientist interview threw a classic logic puzzle at me that I thought I remembered from undergrad. I did not remember it as well as I thought.

Questions Asked (1)

Q1

You have 12 visually identical coins, one of which is counterfeit and either heavier or lighter than the rest (you don't know which). Using a balance scale and exactly three weighings, identify the counterfeit coin and determine whether it is heavier or lighter. Walk through the full decision tree.

Algorithms & Data Structures
Author's notes

I'd seen this puzzle before and that almost made it worse because I half-remembered a solution and kept second-guessing myself.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by explaining the information-theoretic bound: 3 weighings yield 27 outcomes, enough to distinguish 24 possibilities (12 coins × 2 weight states). Then describe a systematic strategy: first weighing 1-4 vs 5-8, and branch based on the result, using the remaining weighings to isolate the counterfeit and determine its weight. Walk through the decision tree clearly, using notation like 'if left heavy' and 'if balanced'.

Pro tip: Mention that the problem is equivalent to coding each coin with a unique ternary code (e.g., L, R, or off) such that no code is the negative of another, and each weighing corresponds to a digit. This shows deep understanding and can simplify the explanation.

1. Establish the information bound

Explain that 3 weighings have 3^3 = 27 possible outcomes, and there are 24 possibilities (12 coins × 2 weight states), so it's theoretically possible. This sets the stage and shows you understand the constraints.

2. First weighing: 1,2,3,4 vs 5,6,7,8

Weigh coins 1-4 against 5-8. If balanced, the counterfeit is among 9-12; if left heavy, it's among 1-8 with specific implications; if right heavy, similarly. This splits the problem into manageable cases.

3. Second weighing: branch based on first result

For each case, design a second weighing that further narrows down the possibilities. For example, if first weighing balanced, weigh 9,10,11 vs 1,2,3 (known genuine). If first weighing unbalanced, use a more complex weighing involving some coins from the heavy side and some from the light side.

4. Third weighing: final determination

Based on the outcomes of the first two weighings, perform a final weighing that distinguishes between the remaining candidates and determines whether the counterfeit is heavy or light.

5. Walk through the full decision tree

Clearly present all branches and outcomes, ensuring that every possible scenario leads to a unique identification of the counterfeit coin and its weight status.

Key Points to Mention

  • Information theory: 3 weighings yield 27 outcomes, enough for 24 possibilities.
  • The need to account for both heavy and light possibilities for each coin.
  • The importance of using known genuine coins in later weighings to simplify.
  • The strategy of splitting the coins into groups of 4 for the first weighing.
  • The use of ternary coding to design weighings and ensure unique outcomes.
  • The necessity of a systematic decision tree to avoid missing cases.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.