Qualcomm Interview Question

pretty standard textbook questions