To use the partitioningBy Collector, you have to pass the Collectors.partitioningBy in the collect() method of Stream API.
how you can iterate over a List, be it ArrayList, LinkedList or any other. Basic loop to iteration to Stream API. And also, figure out which one is best suitable for our code.
An interview cant be complete without this question. HashMap working contains most of the concept we used in our codes. It need hashcode and equals.