Pregunta de entrevista de Petuum

Medium leetcode question and one ML question.