This is a good beginner React interview challenge question

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 พ.ย. 2024

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

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

    This is really good content. Very well done with explaining what you are doing and WHY you are doing it. So often I see things like this where no explanation of why is given. Bravo.

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

    Didn't realise 30 mins have gone by! This is great! Would love to see intermediate/senior react interview questions of this sort as well, please!

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

    Bro these code challenges have been a blessing for my inteview prep and solid understanding of React, keep them coming!

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

    Sooo good! Thanks for that. I like very small examples that show basic functionality. The more complex things on your channel are of course also always very helpful, you are doing a really great job 👍

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

    The custom hook was a nice touch, I've never seen that used before. Great as usual, thank you!

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

    This video was absolutely fantastic! I am quite new to react and programming in general and while some things i managed to solve by myself, you gave so much insight to every step of the challenge which is super helpful. Thank you for your amazing content. Even though i don't speak English natively you explain things so well that it is very easy to understand.

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

    Love this playlist of yours. Your walkthrough and explanations are really helpful. Thank you so much!

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

    This was great especially as a refresher, please do more of these!!

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

    Love your humility, which is rare these days. I'd hire you in a sec just for the fact that you're willing to put yourself out there.

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

    Firstly I've solved that without hooks but your approach is brilliant. I've refreshed my skills. Thank you!

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

    It's very comforting to know that going off the rails is normal, it's borderline crippling for me

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

    As a beginner this video was really interesting to watch, I got to learn a bunch of things, thanks!

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

    These are some awesome videos, man. Really like how you talk through each step of the process

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

    Love you show us how to escape the fails, most important in learning

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

    Good stuff. I'd probably shove in error handling in there as well. One thing I learn along the way was to always think of unhappy path as well.

  • @Dhruv-jf1ho
    @Dhruv-jf1ho 2 ปีที่แล้ว

    sorry for distraction!!!!!! Dude that is really helpful. You hardly get this information so well done.

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

    thanks for video. I also want to mention that react needs keys for every element of list, its not because of linter. when you make changes with an element, react should know what the element should be removed or changed or added. it related with DOM. because react in this moment need to change DOM node or DOM element

  • @hoangtran-ek8mn
    @hoangtran-ek8mn 2 ปีที่แล้ว +1

    Love it! This kind of video is so helpful. I learn so many things from this. Thanks!

  • @CarlosDuque-e3j
    @CarlosDuque-e3j 4 หลายเดือนก่อน

    Great video Cody! I solved it basically in the same way as you except for the custom hook. It was a very goodreview of custom hooks btw. I was also unaware of the Slow 3G option and it is gonna come in handy in the future. I split the search bar and the list into two separate components. Do you think this approach is good or is it better to keep it all in one component as you did?

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

    This channel is really making me learn so much! Thanks

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

      Glad to hear that!

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

      @@WebDevCody learning the small things makes so much impact , it’s not about getting the job i feel it’s more how curious i am towards this and eager to learn as much as i can and seeing you build small stuff makes me so much motivated and just build stuff

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

    Loved this video! Would be awesome if you ever do one of these again, I wouldn't mind seeing you doing some tailwind to style :)

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

    would love to see more React interview questions on your channel, thanks for the video.

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

    Hi, nice content, I am currently preparing myself for interview)). looking forward to more of such videos

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

    great video and useful side remarks! thank you!

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

    I appriciate a lot for you for this content, it helps a lot!

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

    Thank you for this example.

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

    I would like to see more interview challenges

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

    I noticed that on your fetch api, when you set your synonym state to the data returned from the API, you didn't have to directly set the value like setSynonyms(data). I didn't know it works with just setSynonyms() and passing nothing to it.

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

    I wish interview questions were like that.
    In my experience they ask stupidly theoretical questions like "What design patterns do you know?"

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

    Nice video! What's the name of that tool you used for selecting portions of the screen ? It seems very useful!

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

      it's build into mac os for taking screenshots

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

    Excellent content. Thank you

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

    quick question. why is it, that we don't need an useEffect-hook for the data-fetching?
    and very good video, more of this pls :D
    also like your shorts very much, keep it up.

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

      Because the data is fetched when the form is submitted. Why do you think we’d need an effect?

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

      @@WebDevCody i didn't think we needed one, i kinda just didn't understand why we dont need it :D i was under the impression that i have to use useEffect every time i want to fetch data.

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

      @@battimi2647 nah useEffect is whenever you want react to watch a state variable and run a side effect when that variable changes. It’s similar to a vue watch or angular watcher. It’s also useful when you need to run code when the component mounts or rerenders, which is usually what we see, fetch data from api on mount

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

    how about making it like autocomplete where the results are coming up as the user types without hitting the submit button

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

      @@opie0818 exactly what i was thinking

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

      setTimeout. Put up a spinner before then.

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

      That would be very expensive because you would have to make an API call on every keystroke.

  • @ZhivkoShopov-t7e
    @ZhivkoShopov-t7e ปีที่แล้ว

    What is the extension for the red error messages on your screen while coding?

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

    Great stuff! What theme are you using?

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

    you are really a treasure

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

    heeey, this vid is awesome, thanks!

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

    I have a question, since fetching an API is a side effect w.r.t react, why haven't you wrapped fetching in useEffect? Is there a reason

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

      Why would I need to? If the fetch happens on the form submit, why do you think it needs to be in an effect?

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

      Since I saw many developers wrap it up with useEffect i dug deeper and found out it's side effect, I guess we need an useEffect only when we fetch initially let's say on on page load

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

    I love this.

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

    Interviewer: We'd like you to solve this "sample problem" to prove you can do the job.
    Sucker: Writes their app for them. "Do I get the job?"
    Interviewer: "You just wrote the app we're hiring for, unfortunately the position is no longer required".

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

      Never met someone so butt hurt from interview questions in my life

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

    12:05 Can someone explain what exactly this process of setting a type does? I've seen it before, but never really understood it. Are there any videos that talk about when/why you'd do this? Thanks!

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

      you can create types which you use in other places of the code base to add to function parameters so that typescript can verify if you are passing the proper things around

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

    can you make one video about debounce search challenge in react and typescript

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

    I'm a week in learning react and I was able to solve this challenge on my own. Although it took me way longer than you I feel accomplished haha. When I came back to look at your solution I gained more knowledge about the react. Please keep making these challenge question videos they really help.

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

    Cool tip for the react “key” that is required is to use the built in “index” argument that is included with the map callback function. Guaranteed to be unique every time.

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

      That’s actually bad practice. If you use index your stuff can easily render incorrectly if you add or remove from your array. I made a video on that issue

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

      @@WebDevCody Good to know...thanks!

  • @David-vo1rl
    @David-vo1rl 2 ปีที่แล้ว

    Cool video. One question though, is this really junior level? I remember couple of my first interviews, they would just ask about setState and useEffect, how would you pass props to a child component, just basics. Just seems like a lot for a junior dev to know about .env variables, separating component code from API/services, accessibility.

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

      Every company has different requirements for a junior. I personally want to verify the person can at least code something basic

    • @JoseRodriguez-zt5it
      @JoseRodriguez-zt5it 2 ปีที่แล้ว

      @@WebDevCody As long as is not through live coding, otherwise your screening for other things besides dev skills, which aren't always needed. If the job doesn't demand being able to code under high pressure (which no one should under right management), then live coding is pointless. Live coding puts the person interviewing in such a vulnerable state that it takes them back to sort a professor/teacher relation with the interviewer.

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

      @@JoseRodriguez-zt5it what should an interview consist of if not quizzing their technical abilities? There are people who can easily memorize terms for interviews and not know how to solve real problems in code.

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

      Since I'm aspiring to be junior dev in some near future i asked my friends that already are devs how junior interviews look they all agreed it's completely different from company to company. Some can even hire you if you didn't do that good but they have seen that you do have potential and understanding of what your doing they will be willing to teach you and invest in you, some don't even require react or anything other then stock js but on the other hand some have almost same requirements for junior as for senior they just want to pay you less...

    • @JoseRodriguez-zt5it
      @JoseRodriguez-zt5it 2 ปีที่แล้ว

      @@WebDevCody you could test by giving them a technical challenge to do within a certain time frame, like 2-3 days. Then review the code they deliver, and confirm they wrote the code by having a call and ask them questions about the implementation. I think it's a way more accurate indication of how a dev will actually work than doing something like a React tic tac toe in a live coding scenario.

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

    this was basically my interview question about 2 months ago :)

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

      Awesome! Hope you did well

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

      @@WebDevCody Yes! Ill start next month :)

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

    I think i am in big trouble because i can catch up all the things he walk through in this video but i can never think like he did here.

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

    thanks for the video, i have a question tho,
    what addone did you used do show the error inside vscode ? at 16:25

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

      In description

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

    great interview challenge , i need to know the extension for display error while coding , it is really great 👍

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

    Your text manipulation (deleting lines, copying things, moving stuff around) is a lot faster than mine. That's something I'd like to get better at, do you have any videos on that?

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

      I'd rec learning vim motions, speeds up that kind of thing a lot once you get used to it. Awkward as hell to start with though but worth powering through it.

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

      I have a few videos on my vs code shortcuts I use

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

    Hi, can you make a react+typescript+vite+tailwind workflow video? Thanks.

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

    If this is for websites then why not use Live Preview plugin since it’ll bring the website your working on the side of the code so you can see each change as you put in a new line and can test it while also looking at the changes for your desired look

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

      I typically don’t work that way so I don’t want to record a video demonstrating a way I don’t actually work

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

    Just a question. In general I have been taught that when we are fetching data from an api is better to do it inside a useEffect! Isn't this the case here or am I getting something wrong?

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

      Fetch data when data should be fetched. If the api doesn’t need to be hit until you click a button, you don’t need an effect

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

    hey, do u recommend using vite to all projects? is it better?

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

      if you are building a SPA, then yes I would, or use Next.js

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

    This is perfect example to use uncontrolled input, because now you are rerendering all the the, its better to access it with ref, when you need it. And learn to ALWAYS style with classes, no tags nor IDs.

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

      I avoid uncontrolled inputs. But if that works for you that’s cool. The react docs explicitly say “In most cases, we recommend using controlled components to implement forms”, so if you want to do something non standard that’s fine I guess

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

      @@WebDevCody Do you have a specific reason?

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

      @@lukasvaic7159 because now you’re living in a world outside of a react and doing vanilla dom manipulation for no good reason. Just use vanilla js if you want to manipulate dom objects manually

    • @John-mj1kk
      @John-mj1kk 2 ปีที่แล้ว

      ​@@WebDevCody The performance improvement is significant when employing the use of uncontrolled inputs. There's a reason why the most used form library (react-hook-form) embraces uncontrolled inputs.

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

      @@John-mj1kk significant is a stretch for an average form with validation. It maybe saves you 2ms for a form with 20 inputs

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

    I don't know how double ? Works. But if you are doing ternary operation maybe it is interpreting the data muse to be true. That's why you getting same end point. Just an opinion.
    Or you mistaken this ? For this | ?

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

      no clue what you just wrote.

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

      @@WebDevCody me too. Probably using a different react.

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

    I am waiting for another LeetCode video

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

    cool video, thanks 🚀

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

    Thanks

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

    I feel like using ids is something that should be avoided due to default js behaviour of them.

  • @user-zv6bv7eu8k
    @user-zv6bv7eu8k ปีที่แล้ว

    what font is this

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

    Great demo for problem-solving using React. Any chance you could make a video regarding custom hook specifically, I found it's hard to digest with the content given in this video.
    Once again, awesome presentation skill, Thanks.

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

    21:31 is that a doggo in the background

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

      Probably, or my kids 😂

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

    What theme is this?

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

    Thanks for the walkthrough. I would also add `/words?rel_syn=${encodeURIComponent(word)}`

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

    What is the hardest react interview question?

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

      Not too sure, maybe questions deeper about react performance, design choices for building abstract components, questions on order of execution for life cycle events and hooks

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

    Create React App polyfills all the base node things, but Vite does not, that's why the process.env stuff didn't work. Those polyfills are part of why CRA is so slooooow

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

      I though vite is fast because it uses esbuild under the hood and CrA uses webpack

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

      @@WebDevCody That's another reason! There's a lot of stuff that makes CRA slow lol

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

    Awesome

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

    Great vid

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

      how about making it like making it autocomplete where the results are coming up as the user types without hitting the submit button

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

    Good job babe!!!!

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

    Very good😀❤️

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

    good stuff

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

    Bravo TNI

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

    Danke!

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

    In this case binding the onChange event to update state that holds input's value is bad practice. You should just attach 'ref' to the input and then access this data via ref.current.value in onSubmit handler.

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

      Bad practice? Since when?

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

      The react literally say this: “In most cases, we recommend using controlled components to implement forms”

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

      ​@@WebDevCody Maybe 'bad practice' was too harsh there. I meant that chaning it to ref will result in small performance gain, because component doesn't need to rerender itself everytime you type.

  • @立松徹
    @立松徹 ปีที่แล้ว

    cool video)

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

    uncontrolled input + useEffect with word as a dependency

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

    lmao @ 10:35

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

    'good' and 'white' seems like weird synonyms of 'hot'. If the context is 'people' then it's showing quite a bit of bias.

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

    o.O

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

    Honestly, who cares if you're bad at english or speaking. Why say weird off-topic things that provide no value. So odd.

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

      Not sure why that seemed to have bothered you enough to leave a comment 😂

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

      @@WebDevCody I'm having a rough time and it comes out in weird ways.