Algo to find duplicates in a very large array
One thing to keep in mind is that O-notation doesn't necessarily tell you what algorithm is fastest.  If one algorithm is O(n log n) and another algorithm is O(n2), then there is some value M such that the first algorithm is faster for all n > M.  But M could be much larger than the amount of data you'll ever have to deal with.
The reason I'm bringing this up is that I think a HashSet is probably still the best answer, although I'd have to profile it to find out for sure.  Assuming that you aren't allowed to set up a hash table with 10 million buckets, you may still be able to set up a reasonable-sized table.  Say you can create a HashSet with table size 100,000.  The buckets will then be sets of objects.  If n is the size of the array, the average bucket size will be n / 100000.  So to see if an element is already in the HashSet, and add it if not, will take a fixed amount of time to compute the hash value, and O(n) to search the elements in the bucket if they're stored in a linear list(*).  Technically, this means that the algorithm to find all duplicates is O(n2).  But since one of the n's in n2 is for a linear list that is so much smaller than the array size (by a factor of 100000), it seems likely to me that it will still take much less time than a O(n log n) sort, for 10 million items.  The value of M, the point at which the O(n log n) sort becomes faster, is likely to be much, much larger than that.  (I'm just guessing, though; to find out for certain would require some profiling.)
I'd tend to lean against using a sort anyway, because if all you need to do is find duplicates, a sort is doing more work than you need.  You shouldn't need to put the elements in order, just to find duplicates.  That to me suggests that a sort is not likely to be the best answer.
(*) Note that in Java 8, the elements in each bucket will be in some kind of search tree, probably a red-black tree, instead of in a linear list.  So the algorithm will still be O(n log n), and still probably lots faster than a sort.
During one of technical interview got this question.
I know way to solve this problem using (in java) HashSet.
But i could not understand when interviewer forced on the word "a very large array let's say 10 million elements in the given array".
Do i need to change the approach? If not, what should be the efficient to achieve this?
PS: Algo or implementation is language agnostic. 
Thank you.