BNP Paribas interview question

Heap view building