Altimetrik Interview Question

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