BNY interview question

Programing on java