The Prototype pattern is preferable to constructing a new instance whenever object creation is expensive in time, computation, or external resources, and an already-initialized object of the same shape is available to clone.
Key Points: • Ideal when initialization involves costly work like network calls, database queries, or heavy computation. • Cloning an existing object skips repeating that expensive setup for each new instance. • Useful when many similar objects are needed with only small variations between them. • Reduces coupling to concrete constructors, since a clone doesn't need to know the exact class or its constructor signature. • Less appropriate when objects are cheap to construct or when deep-copying complex object graphs would itself be costly.
Example: A trading system that builds a fully-configured OrderTemplate from several downstream service calls would clone that template for each new order rather than re-fetching the same configuration data from those services every time.
Interview Tip: A concise interview answer is:
"I reach for Prototype instead of a plain constructor when creating an object is expensive — say it requires a network call or heavy computation — and I have a fully-built prototype available. Cloning it is far cheaper than rebuilding that expensive state from scratch for every new instance."