Domanda di colloquio di Qualcomm

How will you write program/algorithm to identify an integer if it is power of 2? Converting a string containing numbers to integer I2C, SPI