X interview question

Point out problems in a ruby code.