Deloitte interview question

mainly from java and sql