Short answer
A collision is when two different keys map to the same bucket index.
Explanation
HashMap resolves it with separate chaining: each bucket holds a small list of entries, and get/put walk that list using equals() to find the exact key. If a single bucket's chain grows long (8+ entries) and the table is large enough, HashMap treeifies that bucket into a red-black tree so its worst case is O(log n) instead of O(n). Open addressing is an alternative collision strategy that some other hash tables use.
Common mistakes
- Saying collisions overwrite entries.
- Forgetting equals() picks the right key within a bucket.