Citi interview question

Java concepts