Amazon Interview Question
Software Engineer / DevelopersCountry: United States
Interview Type: In-Person
@ grace you have made a valid point .
for keeping check of duplicate, i.e, item is already there we should also keep hash map of 10 items and before insertion we should check if the item is already there, if it is already there then it should be moved in front of queue by deleting it fom its position (USE DLL)
we can keep a queue of last 10 item visited for every user . whenever a new item will be added last items should be deleted such that only 10 items are kept in FIFO fashion.
- zeroByzero January 03, 2013