Pergunta de entrevista da empresa Infosys

Questions from resume, asked me to write a code in C++, then 1 question on SQL, then one puzzle