Qualcomm interview question

Mainly from data structure Coding questions related to ds