Pregunta de entrevista de J.P. Morgan

they asked me to write a code in angular.