Low Level Design of Snake and Ladder | Flipkart | Amazon | Machine coding Round interview questions

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

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

  • @VY-zt3ph
    @VY-zt3ph 2 ปีที่แล้ว +4

    Bhai Sahab pata nahi kaha se itna tada suggestion aa gya TH-cam se. Playlist dekh ke hi subscribe maar diya.

  • @Paradise-kv7fn
    @Paradise-kv7fn 3 ปีที่แล้ว +9

    few suggestions:-
    1 - We can use a Queue for the players. That would look cleaner.
    2 - We can first take all the input and then call a static method like initializeBoard() or something instead of first initializing the board and then setting the pieces,
    3 - We can use a common abstract base class like BoardEntity(containing a pair for the coordinates and maybe an abstract method isValid() which could check if the cooridinates given for the snake and ladders is valid or not. It will be the opposite check for snake and ladders so they can take care of its implementation. ). This way, if the user provides an invalid input for either the snake or the ladder, then we can directly throw an exception even before we initialize the board(if we also use step 2 mentioned above).
    4 - We could maybe use strategy pattern for the dice roll incase we want to add some variations im generating a random number or maybe use some bias for the outcome for the dice.

  • @riddles4013
    @riddles4013 9 หลายเดือนก่อน +1

    Great, if you use a queue and did in a BFS way then it will look more clean

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

      @riddles4013, can you give little ideo on how you plan to do it with queue and BFS?

  • @anupamakovid4568
    @anupamakovid4568 2 ปีที่แล้ว +1

    good video, easy to understand

  • @nknidhi321
    @nknidhi321 2 ปีที่แล้ว +1

    Awesome !! Thanks

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

    Great explanation bro.

  • @NitinSharma-tq1qb
    @NitinSharma-tq1qb ปีที่แล้ว +3

    If you want it to be singletone, make sure your constructor in Entities is private.

  • @ShekarKamala
    @ShekarKamala 2 ปีที่แล้ว

    Excellent Video Bro

  • @LegitGamer2345
    @LegitGamer2345 ปีที่แล้ว +1

    Where and how have you handled the following rule?
    There could be another snake/ladder at the tail of the snake or the end position of the ladder and the piece should go up/down accordingly.

    • @lavakumar_techie
      @lavakumar_techie  ปีที่แล้ว

      No that is not possible.
      It's not proper snake and ladder design.
      At tail of the snake or up of the ladder should be ideal.
      Till now I didn't see such snake and ladder game 😅

    • @LegitGamer2345
      @LegitGamer2345 ปีที่แล้ว

      @@lavakumar_techie Actually it is there in the rules in the problem statement

    • @lavakumar_techie
      @lavakumar_techie  ปีที่แล้ว

      @@LegitGamer2345 I didnt even realized till now anyway we can do this one.
      only difference what ever logic we written checking if snake is present or not in PlaySnakeAndLadder java file at line 39 we should make move to recursive function and we need to keep track last end position and keep on check till map values null either ladder or snake.
      But its just a type of problem but i never seen such game/
      Thanks for pointing out

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

    but this static singleton entities will not work if multiple games are getting played simultaneously , playername specifically

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

      Yes this use case is not for Multi game

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

    hi lava,where is your trello LLD video? Could find it, if there is not a video on it can you please create it in some 15-20mins of time, will be really helpful🙏🙏

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

      Hi Trello is not asked mostly i didnt see anywhere thats the reason i didnt shared video

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

    for a SDE1 Machine Coding round interview fresher what should be enough from system design point of view
    Please ans

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

      Basics of System design . high level stuff should be sufficient.

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

    Can anyone tell me about MEESHO machine coding round for sde1 backend... NEED A URGENT HELP.

    • @lavakumar_techie
      @lavakumar_techie  5 หลายเดือนก่อน +1

      I have already uploading in the playlist you can see
      Questions will be similar

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

      @@lavakumar_techie Okay brother. Thanks a lot for your reply brother.

  • @saiprasoonat161
    @saiprasoonat161 2 ปีที่แล้ว +1

    Video is nice, would've been even better if your english was better

    • @lavakumar_techie
      @lavakumar_techie  2 ปีที่แล้ว +2

      Ok. I will try to improve next time. Pls subscribe 😃