Do two databases share an ID?
Database A holds records, each with a random -digit ID (uniform over values). Database B independently holds another records with random IDs from the same range.
What is the probability that at least one ID appears in both databases?
Your answer
Solving needs a free account
Answers, streaks and solutions unlock when you are signed in. Reading the question and the hint stays free.
Discussion
Sign in to join the discussion · reading is open to everyone
💡 Discussion rules
- No full solutions here. Hints and approaches only.
- Complexity, edge cases and intuition are the point.
- Interview experiences are welcome. Respect your NDAs.
Loading discussion…
Learn the concepts
The theory behind this question.
Related questions
Two raffle groups sharing a ticket numberDoes anyone on team A share a birthday with team B?Two key sets colliding in one hash tableA card drawn in both of two batchesYour number sits out a hundred rounds
All questions →