Moody's interview question

Pascals triangle algorithm