New York Times Interview Question

Basic String deduplication and sorting algorithms.