Snake and Ladder Low Level Design + Machine Coding | Interview Question asked in Flipkart , FAANG

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 ม.ค. 2025

ความคิดเห็น • 7

  • @ss-xh3hf
    @ss-xh3hf 8 หลายเดือนก่อน +1

    Great one🎉 plz post more of machine coding rounds

  • @nitinmathur7454
    @nitinmathur7454 7 หลายเดือนก่อน

    Where are you using the snake and ladder object? And why do we need so many services ? And repositories as well.

    • @ShubhamHaritash
      @ShubhamHaritash  7 หลายเดือนก่อน

      1. Do you mean snake and ladder dto...then those acts as entity defining them... they are being used in respective repository to store them.
      2. Design Principles: Single responsibility of class.
      3. As asked to keep everything in memory... decoupling that storage logic from actual business/service layer of our application.

    • @nitinmathur7454
      @nitinmathur7454 7 หลายเดือนก่อน

      ​@@ShubhamHaritash I don't see snake and ladder dto being used anywhere in the code, we are directly storing start and end in the map. So many services will also take so many resources. It would be better to have one service and one repository class only

    • @ShubhamHaritash
      @ShubhamHaritash  7 หลายเดือนก่อน +1

      @@nitinmathur7454 I had directly used integer instead of having snake.start.....coz....of data type similarity.....
      Coming to repository and service decision...it's design decisions you may have...but that what design Principles states to us....aka Best practices....adding 2 extra class would not tremendously increase memory usage....as in real life application...there are n numbers of class...code maintaince precides all stuff....

  • @seelammanasa3343
    @seelammanasa3343 หลายเดือนก่อน

    For this no need of UI

    • @ShubhamHaritash
      @ShubhamHaritash  หลายเดือนก่อน

      Nope....you just need to build command line application in any MC round.