Continental interview question

Logic questions and basic C++ problems