CS FundamentalsVery hardHCL · Accenture
An object wraps another object that implements the same interface, adding behaviour dynamically before or after delegating (as BufferedReader wraps a Reader). Which pattern is this?
- A. Adapter
- B. Singleton
- C. Observer
- D. Decorator
Correct answer: D. Decorator
A Decorator adds responsibilities to an object at run time by wrapping it behind the same interface.
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
- Module A calls B and C; B calls D and E; C calls F. In top-down integration testing with depth-first ordering, in which order are modules…
- For a one-month Sprint, the Scrum Guide's maximum time-boxes are 4 hours for the Sprint Review and 3 hours for the Sprint Retrospective…
- A tester re-runs the existing test suite after a developer changes the code, to confirm that previously working features have not broken…
- Which SDLC model completes each phase (requirements, design, coding, testing, deployment) fully before the next one starts, in a strict…
- Which Git command makes a full local copy of a remote repository, including its history?
- In Scrum, who is responsible for ordering (prioritising) the Product Backlog?