Bird
Raised Fist0

After invoking the Director to build a minimal system, what would print(system) most likely display?

easy🧾 Trace Q3 of Q15
OOP & Design Patterns - Factory vs Abstract Factory vs Builder - When to Use Each
Consider a Builder pattern implementation that constructs a computer system with components like CPU, RAM, and Storage. After invoking the Director to build a minimal system, what would print(system) most likely display?
AComputer parts: CPU, RAM
BComputer parts: CPU, RAM, Storage, GPU
CComputer parts: Storage, GPU
DComputer parts: None
Step-by-Step Solution
Solution:
  1. Step 1: Understand the Director's role

    The Director controls the building process and typically builds a minimal or basic configuration.
  2. Step 2: Identify minimal components

    A minimal computer system usually includes CPU and RAM but may omit optional parts like Storage or GPU.
  3. Final Answer:

    Option A → Option A
  4. Quick Check:

    Minimal build includes essential parts only. [OK]
Quick Trick: Minimal build means essential parts only, usually CPU and RAM. [OK]
Common Mistakes:
MISTAKES
  • Assuming all parts are always included regardless of build type
  • Confusing optional parts as mandatory in minimal build
  • Ignoring the Director's control over build steps
Trap Explanation:
PITFALL
  • Assuming Director builds all parts by default, ignoring minimal build logic.
Interviewer Note:
CONTEXT
  • Tests understanding of Builder pattern's Director and product composition.
Master "Factory vs Abstract Factory vs Builder - When to Use Each" in OOP & Design Patterns

2 interactive learning modes - each teaches the same concept differently

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More OOP & Design Patterns Quizzes