Can YOU solve this frontend interview question?

Поділитися
Вставка
  • Опубліковано 21 січ 2025

КОМЕНТАРІ • 284

  • @mewtru
    @mewtru  2 роки тому +64

    If there's anything that I said that was wrong, let me know! I recorded and edited this in about 4 hours last night so there's prone to be some errors haha, but I hope you enjoy the video!!! Be sure to subscribe so that you get notified when new videos come out :)!

    • @mewtru
      @mewtru  2 роки тому +10

      One thing: The abortcontroller should probably be in the effect not in the component body. It doesn't really matter, but it would let effects re-run outside of render.

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

      Would be nice to state the libraries/frameworks in your intro or the description.

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

      The query text shouldn’t be saved as a state as it causes unnecessary rerendering, you can just register to a onChange event on the text field.
      Not to be harsh but I would actually not hire someone that uses setQuery here, it’s a common trap

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

      @@SivicIsntFat So your goal when you interview folks is to trap them? Why?

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

      I think one issue that did come up with the abort controller is that: whenever I deleted the text in the input, the app would crash and display "Error, Cancel Request". What could be causing that?

  • @walkingin6375
    @walkingin6375 Рік тому +6

    Saw this video a while ago, and completely forgot the video, was just in the youtube search with "react programmer girl interview question search" 🤣🤣

  • @rivershertz5967
    @rivershertz5967 2 роки тому +93

    Your video is actually really really good!
    At first I thought "oh this is basic stuff, nothing new here..."
    But then you added layers of complexity which were explained in a simple an informative way!
    Way to go!
    Id become a big fan and a regular atyour channel if you keep uploading this type of videos!
    Your content is awesome!

    • @mewtru
      @mewtru  2 роки тому +2

      Thanks! 😃

    • @umer.on.youtube
      @umer.on.youtube 2 роки тому

      @@mewtru you look like Marissa mayor. Probably the reason I clicked on the vid. 😀

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

      me too. I learned a lot especially with the debouncing, throttling and abort controller sections

  • @harrisonjulius513
    @harrisonjulius513 2 роки тому +4

    A lot of info packed into this video.
    Requires a couple of rewatchs to cement the idea.Thank you for content like this.

    • @mewtru
      @mewtru  2 роки тому +1

      Glad you enjoyed it!

  • @hideinbush0
    @hideinbush0 2 роки тому +10

    I like how you increase the complexity of a common frontend task step by step in an easy to understand manner with multiple solutions. Subscribed.

  • @_MoshikoAz_
    @_MoshikoAz_ 2 роки тому +5

    i love it how you're covering all the concepts and not just step by step as guides normally do,
    thanks

  • @faisalee
    @faisalee 21 день тому +1

    That was beautiful! And your giggle after the debounce worked for the first time :D

  • @tanushmahajan3359
    @tanushmahajan3359 2 роки тому +4

    Love that format ❤️.
    Didn't feel like another step by step tutorial video rather a more in depth tutorial of underlying concepts.
    Really loved it ❤️

    • @mewtru
      @mewtru  2 роки тому

      Glad you liked it!

  • @VELIXYZ
    @VELIXYZ 2 роки тому +2

    This video shows more advanced cases and more advanced information. Though i am not using React, i will rewatch and will implent ideas. This is golden informatioon. Thank you!

  • @alexwilliams5895
    @alexwilliams5895 2 роки тому +32

    Nice job! I interview folks all the time and I rarely get this much detail. The only extra bonus points I would have like to have seen would have been touching on alternative options like filtering from a stream or using a library like react query. But, I still would have hired you 😂. To all the newbs out there, lots of folks don’t know this much and still get hired to entry level positions. Thanks for the video.

    • @Fishamble
      @Fishamble 2 роки тому +6

      This lady knows her stuff. I dont think its fair to compare to noobs?

    • @CS_Sardine
      @CS_Sardine 2 роки тому +2

      @@Fishamble Re read the comment brother

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

      Oh that's great to hear from someone that does interviews! Thank you so much I feel better :).
      I always get stressed out when hearing about coding interviews being a mess etc..

  • @ferhattaher
    @ferhattaher 23 дні тому

    i like how you started from the basics to more complicated stuff ! waiting for more videos like this

  • @kivanc5789
    @kivanc5789 2 роки тому +3

    Tru it would be great if you continue making this type of videos. Haven't heard about throttling before it was so helpful

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

    wow, it was really interesting information about debouncing value!

  • @CodeGoblin
    @CodeGoblin 2 роки тому +1

    fantastic job going over this. I had to build a very complex version of this for work and it can totally be challenging when asked to do it on the spot. Thanks for covering this, subbed.

    • @mewtru
      @mewtru  2 роки тому +1

      Thank you so much :)!

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

    Nice content. I just wanted to point out at 3:20 they are called immideately invoked function expression. Keep it going :)

  • @tylerthomas6932
    @tylerthomas6932 2 роки тому +10

    Really interesting watch, most tutorials don't cover production ready code, which I think was a great addition. Definitely got some tips from this, although I'm a solo dev on a pretty huge MVP product so my definition of production ready is a little different to yours atm 😂

    • @mewtru
      @mewtru  2 роки тому +1

      Haha definitely tried to skew more towards code you could write in an interview vs. being super production ready! But thank you :D

  • @ss5052
    @ss5052 2 роки тому +16

    Really enjoyed how you described your thoughts and explained everything you wrote, thanks!

    • @mewtru
      @mewtru  2 роки тому +1

      Thank you so much :D!

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

    mewtru keep doing these explanation videos its so so helpful, appreciate it so much

  • @slemansafiah8588
    @slemansafiah8588 2 роки тому

    i like the way you explained the idea , we need more from this , all the best

  • @njabz1583
    @njabz1583 2 роки тому

    Tjerrr this is amazing! Everyday I feel more and more like an intern hahah. Subbed!

  • @kefkef5
    @kefkef5 2 роки тому +8

    One small note: In these tests it's often a good idea to also write down how you can further improve the code. For example, since you've nailed down the data fetching abstraction you might want to break it further down into a generic fetching hook, which ultimately leads you to libraries like react-query.
    It shows you have an in-depth knowledge of how it works, but also understand that these patterns are encapsulated nicely in libraries, if you choose to go that route.

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

    This was amazing. Thank you for making it Mewtru.

  • @codewithguillaume
    @codewithguillaume 2 роки тому +1

    Thanks for this exercise! That's real fun :)
    To be honest this is something I did several times by the past, so it's very interesting to see somebody doing it his way!

    • @codewithguillaume
      @codewithguillaume 2 роки тому

      About the query.length => years ago I found a very good way to improve this way better.
      1. setInterval on input (like 1000ms),
      2. loader on UI while there's no response,
      3. if new input, clear interval, repeat :)
      4. no new input, loader disappear, data appears
      2 effects there. The first is: comfortable for users. The second: never spam your API.

    • @codewithguillaume
      @codewithguillaume 2 роки тому

      God ! I just saw you're doing it :) haha commenting while watching.

    • @mewtru
      @mewtru  2 роки тому +2

      @@codewithguillaume Hahaha absolutely no worries! I like the live commenting as you watch 🤣

    • @codewithguillaume
      @codewithguillaume 2 роки тому

      AbortController ❤️

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

    I knew when i watched this it was going to be useful in the future, just implemented a debounce at work with this as a reference, thank you!

  • @Iffythegreat
    @Iffythegreat 2 роки тому +2

    Just found your channel through this video and I love it! Your explanations were so clear and understandable and this was such a relaxing yet interesting video. New sub!!

  • @sydvys
    @sydvys 2 роки тому

    Thank you soo much for explaining everything. So many youtubers just say what they do and don't explain anything

  • @51Grimz
    @51Grimz Рік тому

    I found this example really useful! thank you for making a quality video explaining this in detail, when implemented with a react useEffect!

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

      You're very welcome!

  • @robwatson826
    @robwatson826 2 роки тому

    Only just found you, this was an interesting little video, some great layers going in to solve the problem.
    I've edited this comment because you answered the question toward the end of the video!

  • @NarcisoLobo
    @NarcisoLobo 2 роки тому +1

    First time seeing one of your videos. Instant sub! Great stuff. Perfect for the job seeker who’s past the beginner level.

  • @nj3390
    @nj3390 2 роки тому

    nice vid. more of this please :) and/or please cover about the cache, being production ready codewise. thanks!

  • @kevingonzalez2120
    @kevingonzalez2120 2 роки тому +2

    I have an interview next week and this helped me a ton, thanks!

    • @mewtru
      @mewtru  2 роки тому +1

      Glad it helped! And good luck :)!!

  • @TheMatjo
    @TheMatjo 2 роки тому +4

    Great video! My opinion regarding caching results for less loading time: In your case, where you have simple data that doesn't change that much, it's okay to cache results but if you have data that changes all the time, you would need to fetch data for each request. Otherwise customers will be quick to say "why aren't we seeing fresh results?"

  • @riceball100
    @riceball100 2 роки тому

    Thank you, the way you explained everything was so easy to understand! Looking forward to a day I can explain as well as you.

  • @nothingtosee689
    @nothingtosee689 2 роки тому

    im new to react and have only made one application with it, but you explained everything so well and were so easy to follow. gonna check out more of your videos !

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

    To be honest, I have replayed this video so many many times, just to go through this custom hook example again and again. There must be more potential of it besides debouncing, it is fascinating..., thank you so much 🙂

  • @aldofiore2895
    @aldofiore2895 2 роки тому

    Sick way to describe concepts. I am a 1.5x watcher and I was amazed on easily you explained everything.

    • @mewtru
      @mewtru  2 роки тому

      Thank you so much :D!

  • @DevAditya
    @DevAditya 2 роки тому

    Your videos deserves millions of views 👍

  • @manny8156
    @manny8156 2 роки тому

    This was really fun to watch. Loved it!

  • @juanvillanueva7730
    @juanvillanueva7730 2 роки тому

    Awesome video! Learned a lot about frontend today. Thank you!

  • @vochikhanh3980
    @vochikhanh3980 2 роки тому

    This is exactly what my HR asked me for my interview 😂😂😂😂, thanks for your video that's so much specific explanation.

  • @a7mdbest15
    @a7mdbest15 23 дні тому

    honesly I was wondering why this is 23 minutes, but I think its absolutely worth it, thank you very much for this very informative video.

  • @owaissiddiqui5541
    @owaissiddiqui5541 2 роки тому

    Wow, at first I thought it was a very simple question, but once you got into it, I learned a lot on how much there is it. Great video!

  • @wuschel_the_kid
    @wuschel_the_kid 11 днів тому

    funny i just had this task as a preparation for a technical interview. whats wonky is seeing this done in react and the suffocation created by useState and useEffect. i did this in vue and computed properties. in addition highlighting the query string in the results. great video though, like the calm and collected way you presented this.

  • @RILCOMusic
    @RILCOMusic 2 роки тому +1

    No, but this was amazing to watch and I think I learned a lot. But I definitely dont understand Javascript nearly enough to do any of this haha. I subbed though, you are a fantastic explainer, I normally struggle with these types of videos.

    • @mewtru
      @mewtru  2 роки тому +1

      Don’t worry! It takes time to understand this haha, I remember taking a whole week as an intern trying to debounce some search 😅. But thank yo uso much!!

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

    Thank you for making this video. It was super helpful.

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

      Of course :) I'm glad!!

  • @dayanandhn
    @dayanandhn 2 роки тому

    Add a tip.. keep track of requests and update data correctly thats the crusial part.. slow requests may override the last requests

  • @anthonydefreitas8340
    @anthonydefreitas8340 2 роки тому

    This pattern is usually coded to grab the data just once and filter client side. Great vid, very informative.

    • @mewtru
      @mewtru  2 роки тому

      Thank you :)!

  • @_thehunter_
    @_thehunter_ 2 роки тому

    awesome!! learnt a lot about react.. the whole game is about knowing how to use useEffect..

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

    Really like this videos! Awesome content. I'll be subscribing for more, for sure! thank you

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

    With RxJs debounce is built in, plus Angular would reduce the code in half. Definatly cool to see the native version/react way of doing it. But I'm glad I never jumped on the react hype train.

  • @omereker8824
    @omereker8824 2 роки тому

    Great video, very informative. Thank you, keep up the great work!

  • @athulnath2078
    @athulnath2078 2 роки тому

    Nice one!! Just earned a new subscriber

  • @Tiagocf2
    @Tiagocf2 2 роки тому

    i liked the way you handled request cancelation with flags :)

  • @learnwithleon
    @learnwithleon 2 роки тому +2

    Loved this! Need a whole series of these!

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

    Mortal Kombat 2 cab === instant sub...also you should build a retropie to run literally every arcade game!

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

      Omg that’s the plan eventually!!! This was a Christmas gift haha :)

  • @imranmani2036
    @imranmani2036 2 роки тому +3

    I'm working on a project currently my position is intern and I've to use denounce ( i knew the concept but not able to implement ) Now i can proudly say I can easily implement. Thanks for your great and quality 💕 content.
    Ps: really love your expressions 🥰

    • @imranmani2036
      @imranmani2036 2 роки тому +1

      Implemented successfully and truthfully happy 😁

    • @InsaaZayn
      @InsaaZayn 2 роки тому +1

      Ladki ka chakkar babu bhaiyya ladki ka chakkar 😂😂🤣🤣

    • @imranmani2036
      @imranmani2036 2 роки тому

      @@InsaaZayn babu bhaiya ap to direct he poch gey 😜

    • @imranmani2036
      @imranmani2036 2 роки тому

      @@InsaaZayn kam bhi keya ha babu bhaiya

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

    I wish YT had a super like feature so that I give it to this video

  • @artyCrafty4564
    @artyCrafty4564 20 днів тому

    amazing, More videos like this mewtru !

  • @ozzyfromspace
    @ozzyfromspace 2 роки тому +9

    This was a pretty solid video! Shook that you managed to explore so many things in one problem. Awesome conversation, mewtru! 🏆🎊💯

    • @mewtru
      @mewtru  2 роки тому +1

      Thanks so much!! I'll try and make more like this :)

  • @sirdragoon4625
    @sirdragoon4625 2 роки тому

    Bring more of these

  • @subendernath
    @subendernath 2 роки тому +1

    Understood pretty well. Thank you 😊🫡

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

    I definitely can't. I'm a beginner and will be greatefull when reach 50% of this knowledge. Amazing video!

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

      Glad it was helpful! And one day you will have 100% and more :)

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

    So this is how you implement a feature like this in React. I’ve done this in Vue and Blazor before. Good to know. Any sort of auto-completion should implement debouncing. If you don’t, and you ping my API on every key press, I’m going to throttle your application request limit.

  • @khaledsanny4817
    @khaledsanny4817 2 роки тому +3

    Who said being a frontend developer is EZ ? thank you Mewtru for showing the amount of work to put into a single autocomplete component... It would be cool to learn more "best pratices and programming techniques" to ensure performance. We all know React, Vue or whatever ... but do we know the real engineering behind a production-ready app ? Not sure... Plz teach us more

  • @zackmix
    @zackmix 2 роки тому

    explanation so cool and clearand easy tny for that much love

  • @aesorrells
    @aesorrells 2 роки тому

    As a brand new developer, this is completely over my head, but I hope to one day understand this video 😂

  • @chungbienthanh4076
    @chungbienthanh4076 2 роки тому

    Thanks for sharing and keep going!

  • @mu9190
    @mu9190 22 дні тому

    no need to use the IIFE jsut define the fucntion and invoke it below. also you will see annonymous in errors when using the IIFE

  • @I619WILL619ROX619U
    @I619WILL619ROX619U 2 роки тому +1

    Great Content! Much love

    • @mewtru
      @mewtru  2 роки тому +1

      Thank you!!!!

  • @best-songslyrics3582
    @best-songslyrics3582 2 роки тому

    Thank you so much, for this helpful video, I wish you all the best ✌🏻❤

  • @maithamaloraibi8622
    @maithamaloraibi8622 2 роки тому

    I subscribed for two reasons
    1- I fell into this trap during an interview 😅
    2- Mew is my favorite pokemon 😍

    • @mewtru
      @mewtru  2 роки тому

      Yesss mews great :D and now you’ll do great at that interview

  • @screamnotes
    @screamnotes 2 роки тому

    Cool video. If you're looking for more video ideas I would be interested in videos that go into more detail on some of the topics you mentioned: accessibility in forms, throttling, etc. I like the live coding though. Feels a lot more educational than just talking

  • @vaibhavnayak3416
    @vaibhavnayak3416 2 роки тому +3

    you earned a subscriber.
    I am learning react right now and I am building a project, that takes user input and displays movies based on the input. And this video is helpful to implement this feature.
    Great explanation.

  • @WatchMeLearnIt
    @WatchMeLearnIt 2 роки тому

    Learned a lot! Thank you for the video

    • @mewtru
      @mewtru  2 роки тому

      Glad you enjoyed it!

  • @44chan68
    @44chan68 2 роки тому +1

    you dont' have to use useEffect put this whole function into onchange event into input

  • @nguyenvantien2103
    @nguyenvantien2103 2 роки тому

    a simple example but have a lot of knowledge, first i just watch video to learning and practice my english skills, but you surprised me

    • @mewtru
      @mewtru  2 роки тому

      Thanks! 😃 Glad you enjoyed the video!!!

  • @saman6199
    @saman6199 2 роки тому +1

    Hi, thanks for your detailed explanation, would it be possible to upload more interview questions/solutions? Your content are high quality and very detailed. Thanks for the hard work

  • @derek_d
    @derek_d Місяць тому

    Interesting, I honestly have never really thought of debouncing the actual value itself. I would've debounced the function call.

  • @rumasound6439
    @rumasound6439 2 роки тому

    This is really helpful thanks!

  • @bafian
    @bafian 2 роки тому

    omg too ez i was at least expecting the results to show as suggestions in a custom panel that opens from the input as a dropdown when searching with a spinner inserted in the input

  • @sirdragoon4625
    @sirdragoon4625 2 роки тому

    Error boundaries are generally used with Class Component, how can we implement the same using Functional Component?

  • @creambuncreambun4511
    @creambuncreambun4511 9 днів тому

    Very enjoyable to watch

  • @phx.rafael
    @phx.rafael 2 роки тому

    This video helped me a lot, thank you for the content. \o

    • @mewtru
      @mewtru  2 роки тому

      Glad it helped!

  • @dineshkatariya5966
    @dineshkatariya5966 2 роки тому

    Awesome video, would like to see like this one more 👏

  • @SeanCassiere
    @SeanCassiere 2 роки тому

    VSCode didn't get mad at you here, because you don't have eslint or the react plugin for it installed. Vite typically doesn't include all that extra stuff for linting.

  • @zumalifeguard3493
    @zumalifeguard3493 18 днів тому

    I like it, but I was totally expecting a trie data structure to be used. I mean, this clearly won't scale.

  • @folarichards8704
    @folarichards8704 2 роки тому

    I really enjoyed this. I'd definitely love to see more of these interview question type of content. Some really great ideas and solution to the problem too. Good work,

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

    which themes?

  • @HighHowAreYou69420
    @HighHowAreYou69420 2 роки тому +1

    hi love the content

  • @marianovil
    @marianovil 2 роки тому +1

    I´m learning React and I get lost in the middle of the video, but I like it. Just a simple question, this could be a techinical test in a junior position interview?

  • @phillipgilligan8168
    @phillipgilligan8168 2 роки тому

    BUT... CAN YOU CENTER THIS DIV?!

  • @phucnguyen0110
    @phucnguyen0110 2 роки тому

    Great video! Thank you so much

  • @mm6710
    @mm6710 2 роки тому

    how about using Suspense and useTransition instead of debouncing ?

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

    So I am not ready for a programming job.

  • @vincevdam
    @vincevdam 2 роки тому

    Awesome. Seems like I have a lot more to learn

  • @carameloweb
    @carameloweb 2 роки тому

    when i implement debounce hook stop bring me the values

  • @tsunamigabs
    @tsunamigabs 2 роки тому

    ill comeback to this video someday and understand everything she said
    learning js rn :p

  • @mr.shredder5430
    @mr.shredder5430 21 день тому

    why am i seeing angels this days

  • @parthjohar2273
    @parthjohar2273 2 роки тому +2

    Loved the way you explained debouncing! Great work! What vscode theme are you using?

  • @iamdanajr
    @iamdanajr 2 роки тому +1

    Really a good content, hope there are more coming in the future...also miss your twitch stream.

    • @mewtru
      @mewtru  2 роки тому +1

      I think I'll stream tomorrow! Thank you so much though :)!

    • @iamdanajr
      @iamdanajr 2 роки тому

      @@mewtru have any stream calendar ??