0
0
LLDsystem_design~20 mins

When to use which creational pattern in LLD - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Creational Patterns Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Choosing the right creational pattern for object creation

You need to create multiple instances of a complex object with many optional parameters. Which creational pattern is best suited?

APrototype pattern to clone existing objects
BSingleton pattern to ensure only one instance is created
CFactory Method pattern to create objects based on a common interface
DBuilder pattern to construct the object step-by-step with optional parameters
Attempts:
2 left
💡 Hint

Think about a pattern that helps build complex objects with many optional parts.

🧠 Conceptual
intermediate
2:00remaining
Ensuring a single instance across the system

You want to ensure that only one instance of a configuration manager exists throughout your application. Which creational pattern should you use?

ABuilder pattern to build configuration step-by-step
BSingleton pattern to restrict instantiation to one object
CFactory Method pattern to create configuration objects
DPrototype pattern to clone the configuration manager
Attempts:
2 left
💡 Hint

Think about a pattern that restricts the number of instances to one.

Architecture
advanced
2:30remaining
Designing a system with interchangeable product families

You are designing a system that needs to create families of related objects without specifying their concrete classes. Which creational pattern fits best?

AAbstract Factory pattern to create related objects without specifying classes
BBuilder pattern to construct objects step-by-step
CPrototype pattern to clone existing objects
DSingleton pattern to ensure one instance of each product
Attempts:
2 left
💡 Hint

Consider a pattern that creates families of related objects together.

tradeoff
advanced
2:30remaining
Tradeoffs between Prototype and Factory Method

Which statement best describes a key tradeoff between using Prototype and Factory Method patterns?

AFactory Method clones objects which is faster; Prototype creates new objects via subclassing.
BPrototype restricts to one instance; Factory Method builds complex objects stepwise.
CPrototype requires cloning existing objects which can be faster but needs an initial instance; Factory Method creates new objects via subclassing but may be slower.
DFactory Method ensures only one instance; Prototype creates families of related objects.
Attempts:
2 left
💡 Hint

Think about cloning versus subclass-based creation.

scaling
expert
3:00remaining
Scaling object creation in a distributed system

You have a distributed system where multiple services need to create instances of a complex object efficiently and consistently. Which creational pattern or combination is best to ensure scalability and consistency?

AUse Prototype pattern to clone objects locally and Abstract Factory to ensure consistent families across services
BUse Singleton pattern on each service to ensure one instance per service and Builder pattern to construct objects
CUse Factory Method pattern with centralized registry to create objects and Builder pattern for complex construction
DUse Builder pattern only, letting each service build objects independently without coordination
Attempts:
2 left
💡 Hint

Consider cloning for efficiency and abstract factories for consistency across services.