Qualcomm interview question

Going through code snippets and finding issues/ changing code