Walmart Global Tech interview question

Find k elements of maximum frequency from a file.