Qualcomm Interview Question

C program to reverse an 8 bit type. How would you optimize the program, pros and cons.

Interview Answers

Anonymous

Jul 2, 2012

The fastest way will be a look up table. Keeping reverse values of 8 bit type will require 2^8 entries.

Anonymous

Aug 9, 2012

int byteToReverse; int reverse = 0; int bit = 0; for( int i = 0; i >= 1; reverse += bit; }