Bloomberg interview question

How would you implement Snake? How does a hash map work?