Pergunta de entrevista da empresa Petuum

Medium leetcode question and one ML question.