Deloitte interview question

Mostly core java part