6th Street interview question

how to use comparable and comparator