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 2 - Null Object pattern - Quiz 13medium Behavioral Design Patterns — Part 2 - Why more behavioral patterns solve communication - Quiz 12easy Design — Elevator System - Elevator, Floor, Request classes - Quiz 9hard Design — Elevator System - Multiple elevator coordination - Quiz 8hard Design — Library Management System - Notification system - Quiz 11easy Design — Library Management System - Notification system - Quiz 3easy Design — Parking Lot System - Why parking lot is a classic LLD problem - Quiz 8hard Design — Parking Lot System - Requirements analysis - Quiz 13medium Design — Tic-Tac-Toe Game - Board, Player, Game classes - Quiz 5medium Design — Tic-Tac-Toe Game - Extensibility (NxN board, multiple players) - Quiz 2easy