Amazon.com

  www.amazon.com
Work in HR? Unlock Free Profile

Amazon.com Quality Assurance Engineer Interview Question

I interviewed in Seattle, WA and was asked:
"Given an array of integers, how would you move the duplicate integers into a different array? What is the efficiency of your algorithm?"
Add Tags [?]
Answer

Part of a Quality Assurance Engineer Interview Review - one of 4,652 Amazon.com Interview Reviews

Answers & Comments

2
of 2
votes
In Java I'd do this using a hashset and newly created array(of dups). Simply iterate over the array checking first to see if the value already existed in the hashset. If it already exists add to array(of dups) if not add to hashset.
- Action on Feb 25, 2012

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.