Clairvoyant interview question

Java - Why string is immutable? How hashmap works internally?