C++ code practice for interview.