Pocket Gems Interview Question: Given two arrays of integers,... | Glassdoor

Interview Question

Software Engineer Interview San Francisco, CA

Given two arrays of integers, find which number is present

  in the first array but not present in the second array.

Interview Answer

3 Answers


Make the second array a hash map n insert elements of first array into it.
The element left over is the one not present in second array.

(Given the array size is small)

Anonymous on Sep 28, 2012

I would sort the arrays first,
once you got something like this:


things gotten simple

Anonymous on Oct 24, 2012

Do you have a question about Pocket Gems? Don't ask just anyone for information, ask an employee from Pocket Gems. They're all waiting at Rooftop Slushie.


Anonymous on Jul 15, 2019

Add Answers or Comments

To comment on this, Sign In or Sign Up.