System Design of Chess: Low-Level Design
Ойын-сауық
Let's talk about low-level design interviews.
00:00 Welcome!
06:30 Cplusplus for LLD interviews
08:00 QnA
09:20 Github Link
10:30 What should I prepare for?
12:40 More questions
21:10 Example - Chess App
23:00 Starting with design
23:40 Identifying actors
24:20 Noting Behaviors
27:00 Special moves
27:45 Common behaviors
31:20 Clarifications
32:20 Common behavioral components
35:35 Starting with the Code
37:40 Coding uncommon functions
40:10 Composition vs Inheritance
46:00 Making moves in code
1:00:40 Real Chess Engine
1:02:00 Conclusion
1:03:20 Doubt solving
1:17:30 Updates
1:20:00 InterviewReady Coupon - HELLOWORLD
1. What's the typical interview like?
2. How do you go about solving questions?
3. What are some common myths?
4. Tips for the LLD interview.
Please send your questions here: app.sli.do/event/fsacnpH2vVUZ...
InterviewReady website: interviewready.io
Пікірлер: 16
Great content Man. Thank you!
It was a great session…👍
Gaurav sen is a Indian tech Phenomenon.
I have a few thoughts on the design. One concern is the circular dependency between the board and the pieces. It's important to avoid this kind of dependency. Additionally, allowing each piece to decide whether a move is valid or not would make the application less extensible. For example, if we wanted to extend the application to support Chess960, where the rules for castling are different, it would be problematic. Therefore, the solution is to not let the pieces determine the validity of moves. Instead, we can introduce a separate class called "MoveValidator" that has access to the entire board. This MoveValidator can perform global validations, such as checking whether a player is in check or not. To achieve this, we can define a PieceMoveValidator interface that each piece class can implement. For instance, we can have implementations like PawnMoveValidator, RookMoveValidator, etc. This approach ensures that the pieces remain separate entities from the board and do not need to be concerned with the rules. By introducing the MoveValidator interface, we can easily incorporate the rules of different chess variants. If we wanted to switch from normal chess to Chess960, we would only need to replace the MoveValidator with a chess960MoveValidator. Even in the case of Chess960, most of the pieces can reuse the PieceMoveValidator, except for the king, which has different rules for castling.
Chess Desgin 24:00 min it will start .
Great video. I'm finding it difficult to understand the code uploaded to GIT. Its really huge. What is the expectation in an LLD interview (senior backend engineer) ? a) your code from live video, OR b) the code uploaded to GIT ? c) something in-between a and b Thanks in advance.
How a Piece class can contain Board class object ? You designed Piece class by composing Board and Position object in it. It should be like this Board should contain Various Positions ( 8 * 8) . Each Position can contain a Piece or not.
I saw your chess engine source code . Did you already go through some existing chess engine references to build that chess engine or built all from scratch by yourself ?
@gkcs
Жыл бұрын
It's from scratch. I have been writing code like that since 5 years, so it's easier to do with practice.
@ziakhan-tk7rk
Жыл бұрын
@@gkcs you have been writing the chess engine from 5 years?
@gkcs
Жыл бұрын
@@ziakhan-tk7rk No I have been writing AI algorithms for two player turn based games.
@ziakhan-tk7rk
Жыл бұрын
@@gkcs ah I see so this is what you have been doing since 5 years got that context. Yeah with practise things become easy. Practise makes a man perfect
Great video Gaurav!! But please tell me one thing.. is this much detail really required for LLD interviews ?! 😅
@gkcs
Жыл бұрын
For seniors, yeah.
@dhirajdarakhe3808
10 ай бұрын
it is became general question for any technical interview
temp.makeMove will actually move the piece to destination.correct me if k am wrong