Pregunta de entrevista de Mithi Software Technologies

Why you used this method to implement the code?