Code: https://github.com/17Peeyush/System-Design/tree/main/LLD/StrategyDesignPattern
Here we will learn strategy design pattern, with the help of story when Orin was challenged for a duel and how Orin for each match choose different players (with corresponds to different strategies) and win the duel. Designing and implementing it in java.
Chapters:
0:00 Intro
0:15 Why to learn strategy design pattern
0:25 Story to understand strategy design
02:48 Code Naïve approach
04:46 Story drawback of naïve approach
06:00 Code drawback of naïve approach
06:43 Drawbacks explained
07:26 SOLID (Open close principle)
09:20 SOLID (Single responsibility principle)
10:30 Code strategy pattern
12:50 Advantage of strategy design pattern
13:15 Similarity between strategy and state
14:00 Difference between strategy and state
State design pattern: https://www.youtube.com/watch?v=7s0Ep7SsU_s&t=6s
Disclaimer: I am explaining the Strategy Design Pattern to the best of my knowledge. If you find any inaccuracies, please feel free to correct me or share your insights.
#systemdesign #google #interview #