Deloitte interview question

Java fundamentals, streams, code snippets