Qualcomm Interview Question

Count values based on bits