← Microsoft Interview Insights

Microsoft·Software Engineer·Technical Phone Screen·Intermediate

IntermediatePrefer not to say
May 2026

Summary

Microsoft SWE interview, got asked a classic OOP question that I thought I had locked down but ended up fumbling the nuances a bit.

Questions Asked (1)

Q1

What are the key differences between an interface and an abstract class?

Technical Trade-offsSystem Design
Author's notes

I knew this one cold, or so I thought.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining both concepts clearly, then contrast them across dimensions like inheritance, state, and design intent. Emphasize that the choice depends on the language and the specific design problem, showing you understand trade-offs rather than just memorized differences.

Pro tip: Mention that in languages like C# and Java, interfaces enable multiple inheritance of type while abstract classes allow single inheritance of implementation, and that modern features like default methods blur the lines—demonstrating you keep up with language evolution.

1. Define the core purpose

Explain that an interface defines a contract (what to do) without implementation, while an abstract class provides a partial implementation (how to do it) and can enforce a common base.

2. Compare inheritance and state

Highlight that a class can implement multiple interfaces but can inherit from only one abstract class; abstract classes can have state (fields) and constructors, interfaces cannot (except constants).

3. Discuss design intent and evolution

Explain that interfaces are for defining capabilities that can be mixed into unrelated classes, while abstract classes are for sharing code among closely related classes. Also mention that interfaces are easier to evolve without breaking clients (with default methods in Java 8+).

4. Address language-specific nuances

Acknowledge that differences vary by language (e.g., C# has default interface methods, Java has abstract classes with no abstract methods) and that the choice often depends on the language's constraints.

5. Conclude with practical guidance

Summarize that you should prefer interfaces for loose coupling and multiple inheritance of type, and abstract classes for code reuse and versioning, but always consider the specific context.

Key Points to Mention

  • Multiple inheritance: interfaces allow a class to implement multiple interfaces, but a class can inherit from only one abstract class.
  • State and implementation: abstract classes can have fields, constructors, and concrete methods; interfaces (traditionally) cannot have state and only declare method signatures.
  • Access modifiers: interface methods are implicitly public; abstract class members can have various access levels.
  • Design intent: interfaces define a contract for unrelated classes, while abstract classes provide a common base for related classes.
  • Evolution: adding methods to an interface breaks implementers unless default methods are used; abstract classes can add methods without breaking subclasses if they provide a default implementation.
  • Language-specific features: e.g., Java 8 default methods, C# 8 default interface methods, and the fact that some languages like C++ use pure virtual functions to simulate interfaces.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.