LLD - Design — Parking Lot SystemHow would you extend the Parking Strategy Pattern to support electric vehicles needing charging spots?ACreate a new strategy that prioritizes charging spots for electric vehicles.BModify the existing strategy to ignore vehicle type.CRemove the strategy pattern and hardcode charging spots.DAssign charging spots randomly to all vehicles.Check Answer
Step-by-Step SolutionSolution:Step 1: Identify requirement for electric vehiclesElectric vehicles need special spots with chargers prioritized.Step 2: Extend strategy pattern properlyCreate a new strategy that checks vehicle type and assigns charging spots first.Final Answer:Create a new strategy that prioritizes charging spots for electric vehicles. -> Option AQuick Check:Extend strategy for new vehicle needs [OK]Quick Trick: Add new strategy for special vehicle needs [OK]Common Mistakes:MISTAKESIgnoring vehicle type in strategyHardcoding spots instead of strategyRandomly assigning charging spots
Master "Design — Parking Lot System" in LLD9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepArchTryChallengeDesignRecallScale
More LLD Quizzes Behavioral Design Patterns — Part 1 - Strategy pattern - Quiz 5medium Behavioral Design Patterns — Part 2 - Interpreter pattern - Quiz 11easy Behavioral Design Patterns — Part 2 - Interpreter pattern - Quiz 7medium Design — Elevator System - Why elevator design tests state machines - Quiz 11easy Design — Elevator System - Scheduling algorithm (SCAN, LOOK) - Quiz 13medium Design — Elevator System - Multiple elevator coordination - Quiz 9hard Design — Elevator System - State management (idle, moving up, moving down) - Quiz 13medium Design — Parking Lot System - Concurrency considerations - Quiz 7medium Design — Tic-Tac-Toe Game - Win condition checking - Quiz 12easy Design — Tic-Tac-Toe Game - Board, Player, Game classes - Quiz 10hard