illumifin interview question

Java 8 coding program