VNG Corporation interview question

Solving a queue problem with heap