Mphasis Interview Question

Find the max marks for each department

Interview Answer

Anonymous

Jan 9, 2025

= studentList.stream().collect(Collectors.groupingBy(Student::getDepartment, Collectors.max(Comparator.comparing(Student::getMarks))));