Petuum interview question

algorithm problem