ByteDance interview question

Background