Qualcomm interview question

Typical algorithm questions and some brain teasers