Creational Design Patterns Quiz (Practical)

Q1. In a cross-platform UI framework, the code needs to generate a family of related UI components (windows, buttons, menus) for different operating systems. Which creational design pattern is exemplified by this scenario?




Q2. A logging utility ensures every part of an application receives the same single logger instance. Which creational design pattern is used?




Q3. A reporting tool builds reports in different formats (PDF, HTML, text) through a step-by-step construction process, supplying a different formatter object for each format. Which pattern is being applied?




Q4. A framework defines an abstract DocumentProcessor with process(), which calls an abstract createParser() implemented by subclasses XMLProcessor and JSONProcessor. Which creational design pattern is exemplified?




Q5. A graphics editor duplicates existing shapes to create new ones with the same properties, then modifies them independently. Which creational design pattern is illustrated?




Q6. A cloud services SDK works with multiple providers. At runtime it uses a factory object that supplies related resource objects for the selected provider. Which creational design pattern is implemented?




Q7. An online food-ordering system assembles a Meal object step by step using a MealAssembler, adding components based on customer choices. Which creational pattern does this approach illustrate?




Q8. A plugin architecture for media importers defines importFile() in a base class, which calls an abstract createDecoder() overridden by each plugin subtype. Which creational design pattern is used?




Q9. A web server clones a fully initialized template session object for each new user to avoid repeating heavy setup. Which creational design pattern is applied?




Q10. A print server uses a single spooler instance to manage all print jobs across the application. Which creational design pattern ensures this single point of control?




design-patterns