NTT DATA interview question

scope of variable