ByteDance interview question

Online OA so just problems