Art & Logic interview question

It was about implementing an encoder (part 1) which required brushing up knowledge on bitwise operations as using string manipulation on the input was not the solution they required.