Pergunta de entrevista da empresa Luxoft

Easy hackerank questions, 2 questions on algo and 1 on sql query