Qualcomm interview question

Write a function that determines how many 1s are in an integer.