CodeZettaInterview Hub

NestJS · Dependency Injection · Junior · Concept

Optional dependencies with @Optional() — use cases?

Short Interview Answer

Soft dependencies like metrics/cache that may be absent in some environments.

Detailed Explanation

Handle undefined carefully. Don't overuse — missing required deps should fail fast at boot.

Did you know this answer?