Infogain interview question

pattern programming