Qualcomm interview question

Count values based on bits