Bloomberg Interview Question

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