Choose between a Java Interface and an Abstract Class

Read the full interview experience this question came from →

Quick Overview

Compare Java interfaces and abstract classes through contracts, state, constructors, and inheritance limits. Use concrete design examples to choose between implementation inheritance and composition.

Choose between a Java Interface and an Abstract Class

Company: Apple

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: medium

Interview Round: Technical Screen

What is an abstract class in Java, what is an interface, and how would you choose between them? Explain the inheritance constraints and the kinds of implementation each can provide. ### What a Strong Answer Covers Discuss instantiation, shared instance state, constructors, abstract and concrete behavior, and multiple interface implementation. Avoid treating an interface as a class or claiming that interfaces can never contain method bodies. ### Follow-up Questions - When is composition a better choice than adding a shared superclass? - How should a class resolve conflicting inherited interface defaults?

Overview: Compare Java interfaces and abstract classes through contracts, state, constructors, and inheritance limits. Use concrete design examples to choose between implementation inheritance and composition.

Read the full Apple Software Engineer interview experience this question came from

Apple logo
Apple
Mar 14, 2026
mediumSoftware EngineerTechnical ScreenSoftware Engineering Fundamentals
0
0

What is an abstract class in Java, what is an interface, and how would you choose between them? Explain the inheritance constraints and the kinds of implementation each can provide.

What a Strong Answer Covers Guidance

Discuss instantiation, shared instance state, constructors, abstract and concrete behavior, and multiple interface implementation. Avoid treating an interface as a class or claiming that interfaces can never contain method bodies.

Follow-up Questions Guidance

  • When is composition a better choice than adding a shared superclass?
  • How should a class resolve conflicting inherited interface defaults?