Wiley interview question

Question on DSA,Sql and java 8