Deloitte interview question

Java basics and easy level dsa question