Skip to main content
🔒 Preview mode. The first 15 Foundations lessons are free; this one is Pro. Start a 7-day trial to unlock the editor, AI hints and the rest of the curriculum. Card required, cancel any time in Dashboard.
Start 7-day trial →
⚡
← Courses
›
Interview Prep
›
Module 6 · Concurrency, OS, ML Interview Topics
›
Design patterns: Dependency Injection
quiz
99 / 104
🇺🇸
EN
▼
↗
Share
⋯
More
+100 XP
📋
Task
📖
Theory
🤖
AI Help
Task
📝 **Question:** Why prefer DI? 📋 Pick the right answer. 💡 **Hint:** Re-read the theory above if unsure.
🎯 Quiz
Question
📝 **Question:** Why prefer DI? 📋 Pick the right answer. 💡 **Hint:** Re-read the theory above if unsure.
A
It signals enterprise maturity — frameworks like FastAPI and Litestar use DI containers for everything they build.
B
Inverts dependency — caller controls impl. Tests inject fake; prod injects real.
C
Python's type system requires DI for `Protocol` and `ABC` to behave at runtime under modern strict mypy.
D
DI containers cache singleton instances and improve startup latency over fresh construction in every test.
Submit answer
💬 Discussion
Be the first to ask a question or share a tip.
Sign in
to join the discussion. Reading is free.
Loading discussion…