Loading lesson…
Level 1 · Apprentice0 XP
Buckets, hash codes, collisions and resizing, and why equals and hashCode must agree.
Step 1 / 6
Problemmap["user-42"] returns instantly even with a million entries. A list would have to check items one by one.
← → step
Before this: How coroutines really work
🛠️ Your turn
Reading is not the skill, doing is. Try for ten minutes before you open the hint. Getting stuck first is what makes the solution stick.
1.Create a class with equals but no hashCode, put an instance in a HashMap, and try to get it with an equal instance. Fix it with a data class. Then change a key's field after inserting it and show the map can no longer find it.