🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Quiz: Design Patterns: questions with answers

10 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. Which group does the Observer pattern belong to?
  2. Q2. What does this print? (code)
  3. Q3. A payment module must create a UPI, card or wallet object based on the user's choice, without if/else scattered everywhere. Which pattern f…
  4. Q4. Your code expects send(phone, text) but a vendor library offers pushmessage(payload). Which pattern connects them?
  5. Q5. What does this print? (code)
  6. Q6. What is the key difference between Adapter and Decorator?
  7. Q7. A food app should sort restaurants by distance, rating or delivery time, chosen by the user at run time. Which pattern fits best?
  8. Q8. Which is a real drawback of the Singleton pattern?
  9. Q9. What does this print? (code)
  10. Q10. An object has many optional fields, and a constructor with ten parameters is hard to read. Which pattern helps?