Marlabs Interview Question

Very basic core Java questions and one simple algorithm question.