Amazon Interview Report
- 0of 0 votes
AnswersHow to find Hexadecimal for a 32-digit integer
- geekopedia December 22, 2011 in India| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - 0of 0 votes
AnswersFrom two lists/arrays find duplicates. I gave two answers :
- geekopedia December 22, 2011 in India
1. Sort them both O(n log n)
2. Use a hash table with key as the number in the array and a counter to increment occurences. O(n) to traverse both lists and increment the counters in the hashtable -| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - 0of 0 votes
AnswersI want to build a system with the following APIs :
- geekopedia December 22, 2011 in India
1. put(n) - stores data in the system
2. get() - will give me the element added the first and so on.
I gave a queue implementation using the LinkedList (using a head and tail pointers). Interviewer asked the complexity of both put and get operations and asked how I would implement "removeElement(n)" - now, given a linkedlist/array implementation of a queue, removeElement(n) is going to be O(n) worst case operation, I could not find any other options.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm