Birdeye interview question

Questions on tree DS