ByteDance interview question

Implementing a binary heap from scratch