Qualcomm interview question

C programming and memory questions.