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: Strategy
quiz
98 / 104
🇺🇸
EN
▼
↗
Share
⋯
More
+100 XP
📋
Task
📖
Theory
🤖
AI Help
Task
📝 **Question:** Pythonic Strategy implementation? 📋 Pick the right answer. 💡 **Hint:** Re-read the theory above if unsure.
🎯 Quiz
Question
📝 **Question:** Pythonic Strategy implementation? 📋 Pick the right answer. 💡 **Hint:** Re-read the theory above if unsure.
A
Define `class Strategy(ABC)` with abstract `execute()` and inherit one subclass per algorithm.
B
Pass a callable — Python's first-class functions ARE Strategy.
C
Use a `match`/`case` block on a discriminator string to pick the right algorithm at the call site.
D
Subclass the consumer object once per algorithm and override the method that uses the strategy.
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…