Skip to main content
InterviewHubPRO
Section Overview
Q45

Question 45 of 50

Part 3: Enterprise Architecture, Package Design & Enforcement (25 - 35)

90%
SOLID & OOP Principles (50 Qs)•Part 3: Enterprise Architecture, Package Design & Enforcement (25 - 35)

Interface Pollution and YAGNI: Detecting premature abstraction.

senior LevelTypeScriptSystem Design

In Simple Words:

  • Interface Pollution Anti-Pattern: Creating an IUserService interface for every single UserService when there is only ever one concrete implementation and zero intention of creating another.
  • Creates indirection, requires clicking through two files in IDEs, and provides zero business value.
  • Rule of Thumb: Do not extract an interface until you have at least two distinct implementations (e.g. real vs mock, or Stripe vs PayPal), or when crossing architectural boundaries (domain core to external database).