Bird
Raised Fist0

A developer wrote a module that directly accesses a database from multiple places without any abstraction layer. What anti-pattern does this illustrate?

medium๐Ÿ“ Analysis Q6 of Q15
LLD - Advanced LLD Concepts
A developer wrote a module that directly accesses a database from multiple places without any abstraction layer. What anti-pattern does this illustrate?
AShotgun Surgery
BTight Coupling
CLeaky Abstraction
DMagic Numbers
Step-by-Step Solution
Solution:
  1. Step 1: Define Leaky Abstraction

    Leaky abstraction occurs when internal details (like DB access) are exposed instead of hidden.
  2. Step 2: Match scenario

    Direct DB access everywhere shows abstraction leaks, matching Leaky Abstraction.
  3. Final Answer:

    Leaky Abstraction -> Option C
  4. Quick Check:

    Direct DB access = Leaky Abstraction [OK]
Quick Trick: Expose internals? That's leaky abstraction [OK]
Common Mistakes:
MISTAKES
  • Confusing tight coupling with leaky abstraction
  • Thinking shotgun surgery means DB access
  • Misunderstanding magic numbers

Want More Practice?

15+ quiz questions ยท All difficulty levels ยท Free

Free Signup - Practice All Questions
More LLD Quizzes