Frage im Vorstellungsgespräch bei Amazon

Find duplicate elements in two lists

Antworten zu Vorstellungsgespräch

Anonym

11. Feb. 2016

If there are no space constrains, then convert one of the arrays into hashtable in O(m), and iterate over the other array to find if the value exists in the hashtable in O(n). Total O(m+n).

3

Anonym

3. Feb. 2016

Sort the smaller list. Then binary search each element in the sorted array. mlogm + nlogm = (m+n)logm

1

Anonym

8. Feb. 2016

how long did it take to get the final desicion after the phone interview?

2