LLD - Design — Online Shopping CartWhich component in the Payment Strategy Pattern is responsible for defining the common interface for all payment methods?AContextBConcrete StrategyCClientDStrategy InterfaceCheck Answer
Step-by-Step SolutionSolution:Step 1: Identify the role of each componentThe Strategy Interface defines the common methods all payment strategies must implement.Step 2: Differentiate from other componentsContext uses the strategy, Concrete Strategy implements it, Client uses Context, but only Strategy Interface defines the contract.Final Answer:Strategy Interface -> Option DQuick Check:Common interface = Strategy Interface [OK]Quick Trick: Interface defines common methods for all strategies [OK]Common Mistakes:Confusing Context with interfaceThinking Concrete Strategy defines interfaceAssuming Client defines methods
Master "Design — Online Shopping Cart" in LLD9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepArchTryChallengeDesignRecallScale
More LLD Quizzes Advanced LLD Concepts - Immutability for safety - Quiz 6medium Advanced LLD Concepts - Why advanced concepts handle production systems - Quiz 11easy Advanced LLD Concepts - Event-driven design - Quiz 8hard Design — Chess Game - Piece movement rules (polymorphism) - Quiz 2easy Design — Chess Game - Why chess tests polymorphism and strategy - Quiz 7medium Design — Chess Game - Game state management - Quiz 11easy Design — Food Delivery System - Delivery agent assignment - Quiz 4medium Design — Online Shopping Cart - Order state machine - Quiz 6medium Design — Splitwise (Expense Sharing) - Split strategies (equal, exact, percentage) - Quiz 12easy Design — Splitwise (Expense Sharing) - Balance calculation algorithm - Quiz 13medium