Glasswall interview question

Basic C++ questions, byte manipulation and code clean up.