Pergunta de entrevista da empresa Yandex

Design a function that outputs N most frequent words in a given (large) text file.