Amazon.com
3.4 of 5 2,799 reviews
www.amazon.com Seattle, WA 5000+ Employees

Amazon.com Software Engineer Interview Question

I interviewed in Seattle, WA and was asked:
"How would you remove common elements from a two arrays."
Add Tags [?]
Answer Flag Question

Part of a Software Engineer Interview Review - one of 4,140 Amazon.com Interview Reviews

Answers & Comments

0
of 0
votes
input: array1, array2
output: array3, array4

make a hashmap
load array2 into the hashmap
iterate over array1, elements that are not in the hashmap are added to array3

make a hashmap
load array1 into the hashmap
iterate over array2, elements that are not in the hashmap are added to array4
- Pavel on May 18, 2012 Flag Response

To comment on this question, Sign In with Facebook or Sign Up


Tags are like keywords that help categorize interview questions that have something in common.

Glassdoor is your free inside look at Amazon.com interview questions and advice. All interview reviews posted anonymously by Amazon.com employees and interview candidates.