Google & Microsoft
Java Interview Questions
Amazon Interview Question
Compaq Interview Question
Imagine you have a closet full of shirts. Itâ€™s very hard to find a shirt. So what can you do to organize your shirts for easy retrieval?
Hash it. Take every shirt, and put it in a different drawer depending on the color of the shirt. Whenever you want a shirt, all you have to do is simply open the drawer with the corresponding color. Thatâ€™s hashing in a nutshell.Conceptually easy, if only because most classes hop over this with idealizations. The legendary Udi Manber was fond of saying, â€œhashing, hashing, hashingâ€. Hashing is hard, but donâ€™t be afraid to use it. Imagine you have a closet full of shirts. Itâ€™s very hard to find a shirt. So what can you do? Of course, you might (and likely do) have more than one shirt of a given color. That is hash collision, and there are tons of research papers in the world on the topic, so know that they exist.
Â© 2006 - 2011 Technical-Interview.com . All rights reserved