Target interview question

Java code to debug the issues and scale