Explain how a hash map works internally. What happens during a collision? What is the time complexity of get/set operations and why?