Interview Question: What is a hashmap? -


i asked in interview: "tell me know hashmaps."

i proceeded that: it's data structure key-value pairs; hash function used locate element; how hash collisions can resolved, etc.

after done, asked: "ok, explain said 5-year-old. can't use technical terms, hashing , mapping."

i have took me surprise , didn't give answer. how answer?

lets take big word book, or dictionary, , try find word zebra. can guess zebras near end of book, letter "z" @ end of alphabet. lets can find zebra inside of big word book. way can find zebras, or elephants, or other type of thing can think of in big word book. 2 words on same page apple , ant. sure page want at, aren't sure how close apple , ant each other until page. apple , ant can on same page , might not be, big word books have bigger words.

that's how have done it.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -