CS FundamentalsVery hardGATE CS · TCS NQT Prime · Product Company SDE

A third-party payment gateway's SDK exposes an interface completely incompatible with the shape your application's PaymentProcessor interface expects. Which pattern lets you use the SDK without changing either side's existing code?

  1. A. Composite pattern
  2. B. Bridge pattern
  3. C. Adapter pattern
  4. D. Decorator pattern

Correct answer: C. Adapter pattern

Adapter wraps an incompatible interface and translates calls into the shape the client expects, letting two otherwise-incompatible interfaces work together without modifying either.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic