Comcast interview question

some questions regarding algorithm design