Meta Interview Question

Array manipulation k most frequent elements sorted something similar to a weighted sum linked lists