Qualcomm interview question

Mostly about C/C++ programming, some puzzles