J.P. Morgan Interview Question

they asked me to write a code in angular.