BlueJeans Network interview question

Based on DS and algo,