All quizzesEasy
Creational Patterns
Preview — 3 of 10 questions
What best describes a design pattern in programming?
AA template for writing HTML code.
BA reusable solution to a common problem in software design.
CA way to optimize JavaScript performance.
DA naming convention for variables and functions.
What does the Singleton pattern ensure?
AA class has only one instance and provides global access to it.
BA class can have multiple instances.
CA class creates a new instance for every method call.
DA class cannot be instantiated.
What does the Factory pattern do?
AEncapsulates object creation logic, allowing creation of objects without specifying exact classes.
BCreates factories for manufacturing objects.
CCreates a single object and reuses it.
DPrevents object creation.
Sign up free to play
Answer all 10 questions (7 more), see explanations for every answer, and track your score.