can I ask the inteviewer to assume that there is an external library with a Heap implenentaion likne collectionsjs ?
Heap
collectionsjs