Microsoft Interview Question
Software Engineer / DevelopersCountry: United States
Interview Type: In-Person
how about using hash map... storing each data i.e the coordinates in a table with a key... and everytime checking if the new values are equal to the ones in the table.... if not then adding the pins in the map
To me this would involve some box collision testing to determine which pins are 'in-scope' for the current view. Once a view is established you could store the pins in a HashMap. If the view is shifted, you simply do your collision check again (see which pins lie within the bounding box) and insert the pins into the HashMap. Duplicates will be filtered automatically.
- masterjaso October 25, 2013