Pergunta de entrevista da empresa X

Three exercises. One involving SQL, another one involving dynamic programming and one last involving tries.