TIM Group interview question

How to count the 1 bits in an integer.