Quiz: Design Patterns Questions

Browse questions from Quiz: Design Patterns. Each question has options and an explanation.

Questions — Page 1 of 2

  1. Which pattern is best for constructing an immutable object with many optional fields?
  2. The Builder pattern is useful when an object has many optional constructor parameters.
  3. Which pattern wraps an incompatible legacy API behind the interface your app expects?
  4. The Adapter pattern is mainly used to enforce exactly one object instance.
  5. Which pattern adds behavior such as logging or caching around an object without changing the object's class?
  6. Decorator favors composition over modifying the original class.
  7. What is the biggest risk of forcing design patterns into simple code?
  8. Every Java class should use at least one named design pattern.
  9. A payment provider changed its SDK method names, but your application wants to keep using the same PaymentGateway interface. Which pattern fits best?
  10. A request DTO has many optional fields and constructors are becoming unreadable. Which pattern should you reach for first?

Browse questions

Next page · Quiz overview

Open on QuizMaker