LLD - Behavioral Design Patterns — Part 1Which component in the Strategy pattern defines the common interface for all supported algorithms?AContextBConcreteStrategyCClientDStrategy interfaceCheck Answer
Step-by-Step SolutionSolution:Step 1: Identify Strategy pattern rolesThe Strategy interface declares methods that all concrete strategies must implement.Step 2: Match roles to optionsContext uses the Strategy interface, ConcreteStrategy implements it, and Client uses Context. Only the Strategy interface defines the common contract.Final Answer:Strategy interface -> Option DQuick Check:Common interface = Strategy interface [OK]Quick Trick: Strategy interface defines algorithm contract [OK]Common Mistakes:MISTAKESConfusing Context with interfaceThinking ConcreteStrategy defines interfaceAssuming Client defines algorithm methods
Master "Behavioral Design Patterns — Part 1" in LLD9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepArchTryChallengeDesignRecallScale
More LLD Quizzes Behavioral Design Patterns — Part 1 - Observer pattern - Quiz 4medium Behavioral Design Patterns — Part 2 - Visitor pattern - Quiz 15hard Behavioral Design Patterns — Part 2 - Interpreter pattern - Quiz 14medium Design — Elevator System - Emergency handling - Quiz 10hard Design — Elevator System - Elevator, Floor, Request classes - Quiz 2easy Design — Elevator System - Emergency handling - Quiz 11easy Design — Parking Lot System - Entry and exit flow - Quiz 1easy Design — Parking Lot System - Why parking lot is a classic LLD problem - Quiz 15hard Design — Parking Lot System - Entry and exit flow - Quiz 13medium Design — Tic-Tac-Toe Game - Why game design tests model-view separation - Quiz 5medium