Synechron interview question

mostly on java 8