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?
- A. Composite pattern
- B. Bridge pattern
- C. Adapter pattern
- 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.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- A microservice architecture replaces a single large monolith with many small, independently deployable services. Which of these is a…
- What is the safest way to undo the effect of a single bad commit that is already on a shared branch other people have pulled?
- Which SDLC model is characterised by delivering the product in a series of small, usable, incrementally growing releases, each adding new…
- What is the key practical drawback of the waterfall model that iterative models (incremental, spiral, Agile) were designed to address?
- What is the difference between a mock and a stub in unit testing terminology?
- A build pipeline fails a merge if the newly added code's test coverage for that specific change falls below a configured threshold…