Cargo Chief interview question

questions based on higher functions in javascript