Herald Logic Interview Question

questions are on Oops and DS based java