NTT DATA Interview Question

Related to java8 groupingBy, and Some DS