Pergunta de entrevista da empresa CarGurus

Given a list of strings, sort the strings by frequency. Print the top three most frequent strings.

Resposta da entrevista

Sigiloso

29 de mar. de 2019

Frequency count is trivial. For sorting, I offered to sort the resulting list, maintain a sorted linkedlist or maintain a treeset with a comparator. All these solutions were deemed inefficient.