Pregunta de entrevista de Siemens

Very basic C++ and algorithm question