Pergunta de entrevista da empresa LiveRamp

Pretty straight forward. Basic algorithm questions.