Yahoo Interview Question
Software Engineer / DevelopersCountry: United States
Interview Type: Phone Interview
1) distinct keys and distinct values -> hashing, have a good hash function to have minimum collision and in case of collision have chaining
2) non-distinct keys and distinct values -> Still hashing but hash table of relatively smaller size and if we know that the values are spread uniformly over the namespace/alphabet we can do bucketing.
3) non-distinct keys and non-distinct values -> Hashing, hash table of small size and another hash map for values <value,count> with count as number of times the value has occurred.
in this questions i would like to ask the interviewer about the type of keys and values and what operations are required.
- getjar.com/todotasklist my android app December 10, 2011then i will suggest the data structure.