Oracle Interview Question

Singleton threadsafe in C++, Virtual functions, given two unsorted arrays: find common elements from both.