Qualcomm interview question

Know your programming fundamentals.