Do two files hash into the same bucket?
A hash function spreads keys across buckets, and you may assume each key is equally likely to land in any bucket, independently. You hash two different files.
What is the probability that the two files land in the same bucket (a collision)?
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
Do these two coworkers share a birthday?Two twenty-sided dice showing the same faceWere you two born in the same month?Two friends picking different lottery numbersColliding PIN codes
All questions →