Altimetrik interview question

Asked to write some programs. Basic questions from java , spring