10 React Coding Exercises (CODING INTERVIEW Prep - 2022)

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

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

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

    Definitely got my hands on the keyboard and was fun! Good job 🎉

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

      getting your hands dirty is the only way to test your knowledge and build something. glad to hear that you do these exercises.

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

    The questions were so nice clear and cool, gave a real confidence boost !

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

      I am so glad to hear! Good luck on your interview. You got this.

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

    This is the best React refresher I have found on youtube..Thank you!

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

      thanks for the very nice comment i have received from youtube. i am working on another’s react video so please stay tuned. 🤙🏻😉

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

    extra context at 02:59 : the keyword "children" is a reserved name, it looks for every time a component in this case Parent has a nested child component, we can see this inside the App component: child is nested inside parent and that is how the {children} props given to App() knows who is the child. Just wanted to clarify that this is not magic for those who didn't know, like myself😁

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

      really great ReactJS that one should know. This enables composition pattern.

    • @maysummer-d9h
      @maysummer-d9h ปีที่แล้ว

      Thank you, I was trying to make sense of why no other variable name worked

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

    1:30
    When you set a state based on previous value, it's usually better to use a callback:
    setShow(prev => !prev)
    Setting state is asynchronous. In more complicated cases, weird bugs may occur if you don't use callback method.
    Similar for the counter exercise: setCounter(prev => prev + 1)

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

      good point! Thanks Dirk for pointing it out.

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

    Thanks for creating this concise yet rich coding challenge list

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

      absolutely. I would say this video is the favorite and get lots of love. thanks for providing comment

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

    Great job man! Both Codepen challenges and this video is awesome as a refresher, you should do more of these!

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

      will do. it is one of my popular video so will definitely do another one soon

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

    That was really good fun, thanks! Each one kinda quick and easy, but really well presented and good practice before what will invariably be a weird technical interview 🙂

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

      those interviews 😳 i purposely made these exercises easy and quick as when you know all these fundamentals you can confidently go to these interviews and don’t have to google anything up.

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

    all exercises is most important ..........thanku ,,,,,,,,,,,,,,,

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

    I've had a few of these come up in interviews, from entry to associate level

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

      thanks for the comment. These are fundamentals in ReactJS and if you know or master them, you should be able to do well in the interview

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

    on the callback example, at 2:58 how did parent get the message "Parent has been updated" ?

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

      Parent component passes a setter (hook) as prop to the child. It is a function that updates a state. The child receives this as prop and when it invokes that setter with data, the parent state gets updated.

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

    Exceedingly good. Thanks!

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

      you just made my day! thank you very much 👊😉

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

    yeah great. so efficient ! Genius ! thank you.

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

      thank you Johan! this is one of my most liked video so far and i am hoping to create something similar soon.

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

    In Sum of Two Numbers question, you used +e (+e.target.value), why? What is the significance of using +e.
    When I am not using + sign the numbers are behaving as strings.

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

      `+` is a quick way to convert a string to a number. Number(e.target.value) or parseInt(e.target.value, 10) are the alternatives

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

      @@ASoftwareEngineer Hi, thanks for clarifying. But why were the numbers behaving as string on the first place.

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

      @@priyanshimahajan5453 it is because text/strings are the type of values coming from the input fields by default

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

      @@ASoftwareEngineer but didn't we specified the input type as number?

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

    it has been long time I did not code
    this was a nice refresher thanks 😍
    please post more like this challenges

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

      you are welcome! I appreciate the comment and will post more challenges like this one.

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

    Thanks alot this is very much helpful for me as a beginner in React, a hands on demo video with example and result is much better than a documentation page. 🙏 Once again Thank You very Much 🙏

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

      your welcome Aravind! this channel is created to help engineers learn and land a job and i am glad to hear that this video helped you out!
      stay tuned for next video next week 😉🤙🏻

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

    For best learning TH-cam channel. I like it so much...

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

      Thanks for the sweetest comment I ever received. I tried to make the vids quick and straight to the point.
      What do you like about my style and maybe some things that I may improve?

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

      @@ASoftwareEngineer more vide like this. like coding interview it's more help me to get a job

    • @ASoftwareEngineer
      @ASoftwareEngineer  3 ปีที่แล้ว

      @@nazmulhosens you got it! Expect more videos like this soon. Thanks.

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

    Oracle interviewer asked me solve few of this..Please upload more content like this

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

      you got it!

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

      @@ASoftwareEngineer ye she literally copy pasted the Code Pen link

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

      @@animeshanandcool lol or perhaps just forked my pen after watching my video 😉🤙🏻

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

      @@ASoftwareEngineer Update: I finally have 3 offer letters. I come to this video before any interview to revise.

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

      @@animeshanandcool congrats Animesh! well done 👊🎉🎊

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

    Thank you! Very useful

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

      You are welcome! I am glad that you find this video useful.
      I am hoping that this can reach and help more engineers.

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

    This is good but it really is very basic. can you please make another video with coding assignments the same style like you did here, only for people that are not new to react ?

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

      i made a tic tac toe if you haven’t seen it yet - th-cam.com/video/w8V--ZBzh7w/w-d-xo.html i’ll come up with something else.

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

    For Disable a button, could simply supply the state in disabled attribute:

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

    Where can i get more challenges for my my interview preparation

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

      i can recommend a few things for you like build some projects.
      weather app, tic tac toe, calculator, modal screen, etc
      hope this is enough for now

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

      @@ASoftwareEngineer thanks that's helpful 👍 🙂

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

    Next recommended video to watch - th-cam.com/video/rBhKb9JE8z0/w-d-xo.html (10 React Optimization Tips)

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

    thanks!

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

    Hello, and thanks a lot for the video. One question: why does #7 only works if you name the property "children"? I tried naming it differently, and it doesn't work

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

      children is reserved word and must be used as-is. might be able to rename it using deconstruction if need to be

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

      @@ASoftwareEngineer Ah, clear now. Thanks a lot for clarifying!

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

      @@stankokostic725 you are welcome! glad to help you out.

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

    #7 React Coding - React Children (Exercise) - we could directly use component into parent function

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

      Hi Giorgi! Yes, we sure can but the intent of the exercise is to demonstrate React.children - its implementation and to see that it works.

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

    this is awesome

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

      thank you and I am glad that you liked the video.

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

    Thank you 🙏

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

      You are welcome! I hope that you ace your next interview.

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

      @@ASoftwareEngineer thank you so much 😊

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

    Please post react eco system interview questions if it possible and Please do react and javascript senior level interview questions regularly

    • @ASoftwareEngineer
      @ASoftwareEngineer  3 ปีที่แล้ว

      thanks for the comment. is there anything you like or can be improved on this video?
      ill find time to work on more js advance interview questions. have a good day!

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

      @@ASoftwareEngineer Video quality is good.

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

      @@kovendanragupathi7632 thank you very much! I'll continue to improve and put out videos that are better than the previous one.

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

      here is another video for you if you haven't watch - th-cam.com/video/2j8L8RsHQpM/w-d-xo.html (Object Equality)

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

      @@ASoftwareEngineer Thanks man.please do keep post.I knew the video creation takes time.if you can schedule for the weeks or weekend, that would be good