Bloomberg Interview Question

Implement a virtual file system Sort an array with duplicates of 3 different objects, with only one inspection allowed per object. Sort an array with duplicates of k objects with one inspection per object, O(n)