КОМЕНТАРІ •

  • @RoadsideCoder
    @RoadsideCoder Рік тому +20

    🔴 Get my Complete Frontend Interview Prep course - roadsidecoder.com/course-details
    ➡ Book an Interview Preparation call with me ( 20% OFF for limited time ) - topmate.io/roadsidecoder
    🟪 Follow me on Instagram and u will clear your interview 🤓 - instagram.com/roadsidecoder/

    • @arunyadav7467
      @arunyadav7467 Рік тому +2

      Make more such interview questions on react js this is really great sir

    • @nallaparajuamareshvarma8471
      @nallaparajuamareshvarma8471 Рік тому +1

      Bro please make part 2 I think like target has been achieved

    • @anishmandal1248
      @anishmandal1248 6 місяців тому

      hi there, i'd like to know how would you perform searching for the file and folder in nested folder structure , please add it in 2nd part of it

  • @priyabansal9911
    @priyabansal9911 Рік тому +34

    Haven't seen this kind of briliant content on UA-cam. Keep it up

    • @RoadsideCoder
      @RoadsideCoder Рік тому +3

      Thanks a lot! Please do share with other!

  • @developermanish
    @developermanish Рік тому +21

    Up until now i am thinking i know a lot i mean i know all the thing taught in the video but i never actually tried to write a good code and implementing concepts like event propagation ,custom hooks.
    There's still a lot to learn
    Keep the the good work man

  • @mehulbhatia6008
    @mehulbhatia6008 5 місяців тому +3

    I don't understand why there are so less likes on such a great video. So informative and helpful for interviews. Keep up with such content!

  • @abhishekvishwakarma9045
    @abhishekvishwakarma9045 Рік тому +17

    These kind of questions are very common in tech interviews and are also very interesting, (in one of the interviews I got to build a company-team-employee relationship which looks like an infinite tree structure and at the advance section I need to add a functionality that a team can fire/add an employee and similar for company-team relationship level -> time bound is 90min 🙃)
    I would Like to know your DP solution 😌, thanks for sharing your experience 🔥😎

    • @shagunpreetsingh7105
      @shagunpreetsingh7105 4 місяці тому

      Can you please share you problem's solution.. also if you applied DP as well

  • @ankitkumaryadav562
    @ankitkumaryadav562 13 днів тому

    In DE Shaw - Frontend interview
    I got similar kind of question, but bit advanced
    If you do double click on any folder you can rename the name
    and we can add multiple files inside the folder
    and we can add new Folder in parent directory
    and we can also delete files / folder

  • @hritickjaiswal2393
    @hritickjaiswal2393 10 місяців тому +2

    If you are inserting on the first level then state would be mutated instead of being created new , which is advised in react docs.
    Please check or point out if am wrong.
    Apart from that amazing video.🙂

  • @souvikmitra4953
    @souvikmitra4953 10 місяців тому +2

    Explaining what one learns is a high level skill altogether and you ace this skill. May you have more success than what you currently enjoy going ahead!

    • @RoadsideCoder
      @RoadsideCoder 10 місяців тому

      Wow, thank you for such awesome words brother!

  • @maidenjewel5202
    @maidenjewel5202 24 дні тому

    Amazing Revision Thanks a ton! very simple and excellently explained!

  • @ankitagarwal4914
    @ankitagarwal4914 Рік тому +3

    1000 likes are already done , we are waiting for part2 of this (dynamic programming , edit and delete)

    • @RoadsideCoder
      @RoadsideCoder Рік тому +2

      Thanks for reminder, I'll plan the next video!

    • @ankitagarwal4914
      @ankitagarwal4914 Рік тому

      @@RoadsideCoder thank you

    • @ankitagarwal4914
      @ankitagarwal4914 8 місяців тому

      Hi Piyush - It might be slip through cracks , as time permits request you to release part 2 of this Edit and Delete part

  • @abhisheksaxena4845
    @abhisheksaxena4845 5 місяців тому

    giving marginTop and marginLeft to both files and folders options would have done it for all, the amazing recursive solution is handling everything very crazyyy !

  • @pratikwadekar4981
    @pratikwadekar4981 5 місяців тому

    Brilliant Content and Amazing Walkthrough of the code. The fact that you think of the problems and tackle it into smaller sub problems is really appreciated. Bring more such machine coding problems 🔥

    • @RoadsideCoder
      @RoadsideCoder 5 місяців тому

      find more such questions here - roadsidecoder.com/course-details

  • @ankitkumarjat9886
    @ankitkumarjat9886 Рік тому +2

    You can wrap input inside html form element can listen for onSubmit event
    And browser will handle enter button click and form

  • @jaipurite.k_lalit
    @jaipurite.k_lalit Рік тому +1

    i was really thinking that how vs code folder works and you dropped a video, Thanks a million for this wonderful video💖💖

  • @abhishekpundir5941
    @abhishekpundir5941 Рік тому +2

    Keep uploading these kind of videos...very informative and helpful. Keep growing ❤️

  • @Hari-mr1st
    @Hari-mr1st Рік тому +4

    12:17 was shocking for me as well😮

  • @shagunpreetsingh7105
    @shagunpreetsingh7105 3 місяці тому

    A few questions:
    1. Why to use a custom hook over a util function to insertNode in the tree? Since according to my understanding custom hooks has to be a "utility react component"
    2. Should we deepcopy the actual tree and send that copy to the insertNode function to be cautious of any updations to the actual state (although it won't but we should always copy the state into new variable right?)
    3. Please share the DP solution whenever possible 🙂

  • @EktaTiwari-ts8jl
    @EktaTiwari-ts8jl 4 місяці тому

    Thank you for these videos/tutorials. Where is part 2 of this video on dynamic programming ??

  • @decostarkumar2562
    @decostarkumar2562 9 місяців тому +2

    Sir why to use spearate hook with dfs for addig folder or file ? Can't we juat add extra folde or file at the position where we pressed enter key in the items folder ?
    It is working in my code that's why ...

  • @vergil_389
    @vergil_389 9 місяців тому

    may all the good things happen in your life.

  • @Akash-xv5sk
    @Akash-xv5sk Рік тому +1

    It was really cool, how did you insert folder icon next to element inside JavaScript file itself, please share with us.

    • @RoadsideCoder
      @RoadsideCoder Рік тому +2

      PC - Windows + ;
      Mac - Fn key

    • @jitu11
      @jitu11 Рік тому

      @@RoadsideCoder for Mac, Fn key with which key ?

    • @RoadsideCoder
      @RoadsideCoder Рік тому

      that's it

  • @shouvikchoudhury9691
    @shouvikchoudhury9691 Рік тому +1

    1k likes already completed, plz bring the part 2 of this video

  • @anuragdas1978
    @anuragdas1978 5 місяців тому +1

    I was think of using a priority queue so that the files and folders are in a sorted alphabetical order.

  • @piyushgupta6290
    @piyushgupta6290 Рік тому +1

    Want to see more such machine coding Interview videos so that I can make some good projects for interview and sharpen my web dev skills. Great great job big brother

  • @rakaa31
    @rakaa31 Рік тому +3

    are bhai Saturday ko hi release krte, Sunday Evening is kind of relaxing!

  • @Sandeep-zd6dq
    @Sandeep-zd6dq Рік тому +1

    At 12:20, same reaction 😂😂😱🔥😎 then thought ki abhi kuch nhi aata apne ko abhi bahut kuch seekhna pdega 😂

  • @thirunavukarasusaminathan3102
    @thirunavukarasusaminathan3102 Рік тому +1

    I really love this video and the concept of this unique one.👏👏

  • @UmeshYadav-no7vm
    @UmeshYadav-no7vm Рік тому

    Please make second part of this video. Thanks

  • @AvinashSingh-tr5vt
    @AvinashSingh-tr5vt Рік тому +1

    Amazing! Eagerly waiting for 2nd part

  • @coderDas
    @coderDas 3 дні тому

    What the hell man, this is real react Bro 🔥🔥🔥

  • @Ravi_Goyal
    @Ravi_Goyal Рік тому

    in insert node function if we want to add folder to public then it will traverse rest of the folder also. we can stop if folder is added not to traverse rest of the folders.
    latestNode = tree.items.map((ob) => {
    return insertNode(ob, folderId, item, isFolder);
    });

  • @SeagullKarwan
    @SeagullKarwan 2 місяці тому

    It is really cool video, but I don't understand how could you use Folder component inside the Folder component. I got an error: ReferenceError Folder is not defined.

  • @RohitKumar-ly6pb
    @RohitKumar-ly6pb Місяць тому

    can't we call the creation of new file/folder in Folder component itself? because it already knows which item is being clicked upon via button click, so we can push the item in array from there only.
    // Folder component
    const Folder = ({ folder }) => {
    // called on enter of input field.
    const addNewFileFolder = () => {
    folder?.items?.push({
    id: 10,
    name: inputValue,
    isFolder: showInput?.isFolder,
    items: [],
    });
    }
    };

  • @aaryansj8016
    @aaryansj8016 Рік тому

    Tysm bro.... I wasn't able such stuff in my project.... thanks..!!!

  • @arunyadav7467
    @arunyadav7467 Рік тому +1

    Make more such interview questions on react js this is really great sir

  • @prikshit8
    @prikshit8 Рік тому

    recursion wala part. mind blown

  • @NomadStriver
    @NomadStriver Рік тому

    This is great explaination. We need part-2 video.

  • @rakeshkharvi4145
    @rakeshkharvi4145 Рік тому

    Wow beautiful. Recursion thing works here !

  • @lakshaythegupta
    @lakshaythegupta 2 місяці тому

    Why cant we just store individual folder data separately in a Map and just render the files and folder in it using the folderid? To add a new file all we have to do is push to that particular folder in O(1) . Similarly, adding folder will be adding the folder id to parent folder and adding a new entry to the Map. Why didnt we use that approach ?

  • @shivankkunwar9669
    @shivankkunwar9669 11 місяців тому

    Can you also share in real interview how would you go about thinking of structure of data like the JSON data you use - wouldn't this require thinking all the possibility of data required and hence first completely thinking about the structure of the app ?

  • @learningjoe1823
    @learningjoe1823 Рік тому

    I am a full stack developer (Reactjs, Nodejs MySql, Mongodb) with one year of experience at a service based company. I am looking for a frontend role specific job in a product based company.

  • @akashdasgupta7493
    @akashdasgupta7493 8 місяців тому

    Bro the problem was same and what you experienced same I did, even I was shocked how did it recursively call the component 😂

  • @dimplesingh5329
    @dimplesingh5329 Рік тому

    This type of question was asked to me when I was giving interview for Value labs.

  • @AnuragArwalkar
    @AnuragArwalkar Рік тому

    We dont need to traverse the ree to add element we can use reference variable to push the children and then we can force render react component

    • @RoadsideCoder
      @RoadsideCoder Рік тому

      But will that update the explorer object?

  • @hritikamathur3729
    @hritikamathur3729 Рік тому

    Such informative and easy to understand videos you make!
    Thank you 😊

  • @malleswararaoganapavarapu8685
    @malleswararaoganapavarapu8685 3 місяці тому

    Instated of Json file , i would like to upload files and display as file explorer. Please give me the code if you have

  • @arpitj07_
    @arpitj07_ Рік тому

    Great Video !! Looking for the part two now !!

  • @SricharanS-z3d
    @SricharanS-z3d Рік тому

    I got this question in an Interview. They asked me the same to do in vanilla javascript.

  • @aqibmalik6313
    @aqibmalik6313 4 місяці тому

    You promised another video on this after 1k likes and ur video already has 2.6k likes
    Please uploading the continuation video

  • @coderRox
    @coderRox 9 місяців тому

    Nice video, you have the explorer reference, i don't think we need the useTraverseTree hook.

  • @nikhilchawla6482
    @nikhilchawla6482 4 місяці тому

    As we already have the reference to the object and items so cant we add directly to the items the new folder of file instead of looping and find. can someone explain?

  • @creatorstudio5945
    @creatorstudio5945 6 місяців тому

    Sir, are such questions asked from fresher too?

  • @praveenreddy-li6ft
    @praveenreddy-li6ft Рік тому +1

    Hi Piyash, please let me know how can we achieve this in JavaScript.
    const arr = [1,4,1,2,5, 2,5,2,3];
    Then the sorted array should be like below
    const output = [4,3,1,1,5,5,2,2,2];

    • @praveenreddy-li6ft
      @praveenreddy-li6ft Рік тому

      this is one of the interview questions

    • @tuber9930
      @tuber9930 Рік тому

      Using map to count the each value,
      And push it array with counted value, and print it

    • @syednaqvi6572
      @syednaqvi6572 Рік тому

      not getting the problem statement itself if occurrences are same then push the larger one first e.g occurrence of 4,3 is 1 so we pushed 4 first as it is larger than 3. The occurrence of 1,5 are 2 so according to previous statement 5 should have been pushed first no ? output=[4,3,55,11,222]? Please correct me if I'm wrong

    • @vamshikrishna6001
      @vamshikrishna6001 10 місяців тому

      ​@@syednaqvi6572to my knowledge it's wrong

    • @vamshikrishna6001
      @vamshikrishna6001 10 місяців тому

      Can be done with 4 nested "for " loops😅

  • @Wassim971
    @Wassim971 Рік тому +3

    Isn't tree.items.unshift() mutating the original react state?

  • @nitigyajoshi4658
    @nitigyajoshi4658 Рік тому +1

    Why did you destrustured showInput at @18:35 inside setShowInput? (setShowInput({...showInput, visible: false}))

    • @anjalii1102
      @anjalii1102 Рік тому +1

      If you simply use setShowInput({ visible: false }), it would replace the entire showInput state object with a new object that only has the visible property. This would cause you to lose any other properties in the showInput state, such as the isFolder property.
      (...) update the state while preserving the other properties.

  • @anandbaraik5010
    @anandbaraik5010 Рік тому

    Can you build `n level comments` app for mahine coding? Kindly bring something like this.

  • @rohitrox73
    @rohitrox73 Рік тому

    bhai what should i do to get interview from big tech company for react js developer

  • @mazenfayez5824
    @mazenfayez5824 Рік тому

    as express backend developer, what topics should i cover before the interviews , auth , tokens , hashing , restful api and database , is there anything else should i study?

  • @chetanj5031
    @chetanj5031 Рік тому +2

    Hi,
    In use-traverse-tree hook, isn't it wrong to mutate the state directly by doing tree.items.unshift ?

    • @mehulsinghteya9144
      @mehulsinghteya9144 Рік тому

      I was also looking for the same thing. In my opinion, we can use the native window.structuredClone() function to make a deep clone the state object first then we can mutate the new duplicated state variable in the functions.

  • @kashmirtechtv2948
    @kashmirtechtv2948 6 днів тому

    what about DSA in presence of Chatgpt? 29:40

  • @sunilsarode152
    @sunilsarode152 10 місяців тому

    Superb content , thanks a lot :)

  • @roshan-jha
    @roshan-jha Рік тому +13

    Don’t you think useTraverseTree is an extra added complexity?😅 You could’ve used folder object reference directly🙃 then and there.

    • @silverbullet_6
      @silverbullet_6 10 місяців тому +1

      exactly I did the same
      @RoadsideCoder please ans if we missing something

    • @anuraggharat5453
      @anuraggharat5453 10 місяців тому

      @@silverbullet_6 what approach did you use? can you explain ?

    • @silverbullet_6
      @silverbullet_6 10 місяців тому

      @@anuraggharat5453 adding a new folder using the reference passed in every folder component

    • @nishantmoolya
      @nishantmoolya 6 місяців тому

      ​@@silverbullet_6 can u explain in more detail and is the UI gets updated by this method?

    • @silverbullet_6
      @silverbullet_6 6 місяців тому

      @@nishantmoolya yes it gets updated!!
      when you loop in the file just pass the reference of the current object and then update it as required. that's it

  • @helix8847
    @helix8847 Рік тому

    Would there be much difference doing this with TS?

  • @TheMayankkhare92
    @TheMayankkhare92 Рік тому

    What is the interview process at Microsoft for Frontend Engineer roles?

  • @AnkitncrVlogs
    @AnkitncrVlogs Рік тому +1

    how to make table Data shorting This is my Interview question With MNC ...
    // on first click list will sorted in assending order
    // on second click list will be sorted in descending order
    // on third click default list will be rendered
    // on fourth click again start form step 1

  • @ibrahimsayyad5824
    @ibrahimsayyad5824 Рік тому

    Great project. Thanks for sharing

  • @projectsnik305
    @projectsnik305 Рік тому

    Bro can't we just do this with Redux or Zustand instead of custom hook??

  • @maneetsingh252
    @maneetsingh252 Рік тому

    I have live coding test tomorrow on javascript and react js what questions I can expect please reply 🐸

  • @indraxios
    @indraxios 10 місяців тому

    Yes DSA is used, but only basics, not those wiredo leetcode problems, most of the times where intense dsa is needed, those things are done by DSA specialists

  • @samyakjain4715
    @samyakjain4715 Рік тому

    Why this tree is not getting affected by pass by reference?

  • @importcode6908
    @importcode6908 Рік тому

    Sir ,love the way you taught us but can you give some intuition and insight before directly jumping to coding part so we can think about how we should approach for the solution

  • @somyaranjandas4599
    @somyaranjandas4599 4 місяці тому

    you are boss of frontend

  • @amulkumar5-yeariddminingen159
    @amulkumar5-yeariddminingen159 8 місяців тому

    this whole playlist is cool

  • @parmarhitendrasinh4504
    @parmarhitendrasinh4504 Рік тому

    can you please give hint about applying dp on this problem

  • @MrColins710
    @MrColins710 11 місяців тому

    good lesson, thanks for you work

  • @faaizalam235
    @faaizalam235 Рік тому

    Bro please make more machine learning videos best work, and great contributions for new devs

  • @isha25tripathi12
    @isha25tripathi12 6 місяців тому

    how were you able to think this at the time of interview , I won't be surprise if I forget for loop one day in the interview 😂

  • @arwahakimuddin4595
    @arwahakimuddin4595 Рік тому

    Hi , How do u open browser tab in VS code?

  • @asparshraj9016
    @asparshraj9016 Рік тому

    Oh boy, I still need to learn a lot.

  • @jagjot1697
    @jagjot1697 Рік тому +4

    Great video! Can you share the codesandbox link? Also, if possible please make more videos with real world use cases of DSA. Maybe then I can finally convince myself to get on that Leetcode grind one day xD

  • @yashmishra9978
    @yashmishra9978 7 місяців тому

    Can someone explain how the Folder can be called inside the Folder itself?
    12:20
    I haven't heard of this concept before.

    • @RoadsideCoder
      @RoadsideCoder 7 місяців тому

      It is called Recursion,I have made a video on this concept as well -
      ua-cam.com/video/DICBCBZn_L4/v-deo.html

  • @gauravkalita143
    @gauravkalita143 4 місяці тому

    By creating files inside HandleNewFolder, you are violating SRP.

  • @mystory5328
    @mystory5328 Рік тому

    Thanks your content. Can you make a big project based on typescript redux toolkit.

  • @debugloop
    @debugloop Рік тому

    what mic do you use bro ?

  • @saurabhbisht2238
    @saurabhbisht2238 Рік тому

    did you had a round in cars24?

  • @vamshikrishna6001
    @vamshikrishna6001 3 місяці тому

    Waiting for Dynamic programming algorithm.

  • @rakaa31
    @rakaa31 Рік тому +1

    nyc brother make some interview questions on react

  • @karunasagarks5228
    @karunasagarks5228 7 місяців тому +1

    Part2 please

  • @dineshkumargiri1659
    @dineshkumargiri1659 Рік тому

    We are waiting 😍😍

  • @vincent3542
    @vincent3542 Рік тому

    it's really cool broooooo!!!🔥🔥🔥🔥🔥🔥🔥🔥🙇🙇

  • @harshitsachan154
    @harshitsachan154 4 місяці тому

    Thanks for masterpiece.

  • @jitu11
    @jitu11 Рік тому

    Great content and explanation.

  • @varungondu7053
    @varungondu7053 11 місяців тому

    I got this question in citizens bank interview

  • @thekamol
    @thekamol Рік тому

    What a interesting and useful video, thanks Piyash a lot! More kinda react videos please! 🔥🔥

  • @VijayNavale-xk6nk
    @VijayNavale-xk6nk Рік тому

    so basically it is kind of recursion going on where map will loop inside that again map loop and its goes on...

  • @cworks73
    @cworks73 Рік тому

    Pakka test! Tnx

  • @iplmaniac
    @iplmaniac Рік тому

    Please make videos on these-
    Comment system
    Kanban Board
    Pagination
    Carousel/Slider

  • @guryashzone
    @guryashzone Рік тому

    Mind Buzzing.

  • @mukulsharma7540
    @mukulsharma7540 Рік тому

    How did you get the folder icon @piyush at 7:50

    • @suyogchaudhari9992
      @suyogchaudhari9992 6 місяців тому

      press windows+. and type folder to get that emoji

  • @anchalgupta8293
    @anchalgupta8293 Рік тому

    This is easy way , try to make directory with depth of each node