Capgemini Interview Question

2 coding questions related to java 8 and design pattern