Pergunta de entrevista da empresa Amazon

Find duplicate elements in two lists

Respostas da entrevista

Sigiloso

11 de fev. de 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

Sigiloso

3 de fev. de 2016

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

1

Sigiloso

8 de fev. de 2016

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

2