1. In modern HotSpot JVMs, which structure does HashMap use when a single bucket becomes too large?
HashMap maintains a linked list per bucket; when collisions make a bucket long (e.g., ≥8) and capacity is sufficient, it treeifies that bucket into a red-black tree. This improves worst-case lookups from O(n) to O(log n).