Qualcomm Interview Question

Mostly about C/C++ programming, some puzzles