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:MISTAKESConfusing 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 - Code review checklist for LLD - Quiz 1easy Design — Chess Game - Observer pattern for UI updates - Quiz 4medium Design — Chess Game - Board and piece hierarchy - Quiz 3easy Design — Chess Game - Why chess tests polymorphism and strategy - Quiz 13medium Design — Food Delivery System - Restaurant, Menu, Order classes - Quiz 7medium Design — Food Delivery System - Notification to all parties - Quiz 15hard Design — Food Delivery System - Rating and review system - Quiz 9hard Design — Hotel Booking System - Cancellation and refund policy - Quiz 13medium Design — Online Shopping Cart - Product, Cart, Order classes - Quiz 8hard Design — Splitwise (Expense Sharing) - Simplify debts algorithm - Quiz 13medium