Thursday, October 29, 2009

Java Interview Question

Here the questions

Given two Integer Array fill with random Integer number, write an effective Java method that will accept the two integer Array above, find out number that exists in both array, and print out the common number sorted, start with smallest number..

e.g

Array 1 - [5, 2, 1, 107, 20,93, 88, 100]
Array 2 - [100, 65, 12, 34, 5, 2, 99, 100, 107]

The method should print out 2, 5, 100, 107
Am surprise that many people don't get it right....