React JS Interview Questions ( OTP Login ) - Frontend Machine Coding Interview Experience

Sdílet
Vložit
  • čas přidán 25. 06. 2024
  • 🔴 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 🤓 - / roadsidecoder
    React Interview Question on implementing a OTP login with Phone Number feature will be created in this video along with tips and tricks to tackle your React JS and JavaScript Questions in Frontend Machine Coding Interviews.
    👤 Join the RoadsideCoder Community Discord -
    / discord
    🔗 React JS Interview Series -
    • Frontend Machine Codin...
    ➡️ Source Code -
    github.com/piyush-eon/fronten...
    🔗 Strings Video -
    • Strings - Data Structu...
    🔗 Complete Data Structures and Algorithms with JS Course - • Data Structures and Al...
    🔗 JS Interview Series -
    • Javascript Interview Q...
    🔗 Cars24 Interview Experience -
    • Frontend Interview Exp...
    🔗 Unacademy Interview Experience -
    • Frontend Interview Exp...
    🔗 Tazorpay Interview Experience -
    • Frontend Interview Exp...
    🔗 MERN Stack Tutorial with Redux -
    • MERN Stack Project Tut...
    🔗 React Beginner's Project Tutorials -
    • React JS Project Tutor...
    #JavascriptInterview #ReactInterview #ReactJS
    -------------------------------------------------------------------------
    00:00 Intro
    01:05 Setup New React App
    03:12 Phone Login Component
    10:42 OTP Input Component
    16:08 Styling OTP Inputs
    16:57 OTP Field focus after First Render
    19:29 Updating OTP Field Logic
    25:26 Move to Next Field after Input
    27:08 Move to Previous Field on Backspace
    29:08 Move Cursor to Last on Click
    31:00 Adding More Validations
    33:11 Homework for you
    33:52 Secret Announcement
    -------------------------------------------------------------------------
    ⭐ Support the channel -
    / @roadsidecoder
    Special Thanks to our members -

Komentáře • 106

  • @RoadsideCoder
    @RoadsideCoder  Před 5 měsíci +4

    🔴 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/

  • @manojinderparmar2277
    @manojinderparmar2277 Před 4 měsíci +3

    Thank you so much for creating such a usable OTP component. I have implemented it in my project after learning it from you.

  • @griffinannshual4205
    @griffinannshual4205 Před 5 měsíci +2

    Great video brother, learned a lot!

  • @kiva1806
    @kiva1806 Před 5 měsíci +1

    Outstanding very useful video & doing a great job bro🤓🤓🤓

  • @omrajgure4553
    @omrajgure4553 Před 5 měsíci +2

    Hey you are awesome 🙌….your channel is so underrated 😢…..thanks for this great content and try making a playlist of you developing complex only react projects ❤…..you gained a sub 🎉

  • @amitavasengupta5580
    @amitavasengupta5580 Před 5 dny

    I had my machine coding round yesterday and the interviewer asked me to code this otp functionality. He was super impressed and I got selected in the technical round, next is hr round. Thanks dude for making this awesome content. Wish I had even 50% of the knowledge you have then I would be a superhero like you

  • @hamzaseif4992
    @hamzaseif4992 Před 5 měsíci +8

    Me : there is no way i will get asked these tricky js questions in my interview but lets watch roadsidecoder js interview questions anyway,
    95% of the questions were from your videos lol , thanks a lot

  • @subhadeepghosh2813
    @subhadeepghosh2813 Před 5 měsíci

    U are really doing a great job bro

  • @web_dev_with_ak
    @web_dev_with_ak Před 5 měsíci +2

    Very very very useful video for frontend developers.
    Thank you for giving the knowledge 👌👌👌👌

  • @rocs11
    @rocs11 Před 5 měsíci +2

    Awesome tutorial! I'm new to React and I followed along in Typescript and had no problems.
    Very good explanation of why you use particular methods/patterns in certain situations!
    btw, you jump scared me with the Instagram sponsor 🤣

    • @H_NileshKumar
      @H_NileshKumar Před 4 měsíci

      Is it necessary or important to shift to typescript in react?

    • @rocs11
      @rocs11 Před 4 měsíci

      @H_NileshKumar Neither TypeScript nor JavaScript is strictly better for React development in all cases.
      But it has its advantages, like type safety and better IDE support (autocompletion, etc.).
      So, for more complex projects, I will use Typescript, and for fast prototyping, I'll go with Javascript.
      But again, it's also a preference.

    • @H_NileshKumar
      @H_NileshKumar Před 4 měsíci

      @@rocs11 I see , well I just found that I suck at logic building. Maybe bcoz I haven't done many projects with simple js ,so I'm doing that rn

  • @goshmain982
    @goshmain982 Před 4 měsíci +1

    this is practical example of real world enterprise grade production ready tutorial thank you so much

  • @LENDUONG-er3zq
    @LENDUONG-er3zq Před měsícem

    hay quá anh zaii oiiii

  • @ManoharBatra
    @ManoharBatra Před 5 měsíci +1

    best video on machine coding, you covered many things in one video.. kudos... let's collab again because my audience is waiting :)

  • @anusmitakundu2366
    @anusmitakundu2366 Před 4 měsíci

    This is so good. 💯

  • @subramanianchenniappan4059
    @subramanianchenniappan4059 Před 5 měsíci

    Great . Thanks 😍😍.

  • @BharatShortsIN
    @BharatShortsIN Před 4 měsíci

    Great video... Brother...🎉🎉🎉🎉

  • @soumyadyutinandy5119
    @soumyadyutinandy5119 Před 5 měsíci

    Just implemented wordle and it is very similar to this concept

  • @captainjacksparrow8916
    @captainjacksparrow8916 Před 5 měsíci

    Thank You sir jii

  • @prashanthgv86
    @prashanthgv86 Před 5 měsíci +1

    Please create a video on Form Validations

  • @Aviralsingh-yw7xx
    @Aviralsingh-yw7xx Před 5 měsíci +2

    Thanks a Lot Sir.

  • @technicalrider6196
    @technicalrider6196 Před 5 měsíci

    Continue this series

  • @jsagar95
    @jsagar95 Před 5 měsíci

    Thanks!

  • @srikarravoori124
    @srikarravoori124 Před 5 měsíci

    I have got the downloaded file. Thanks

  • @aqibmalik6313
    @aqibmalik6313 Před 5 měsíci +1

    this has many bugs
    click backspace on 3 field gives error
    backspace does not remove the value in first field

  • @AshikRahman-fw3sv
    @AshikRahman-fw3sv Před 5 měsíci

    WOW 😲😲😲

  • @akshaylokray
    @akshaylokray Před 4 měsíci

    @RoadsideCoder how to build Aadhar input box where we have 3 input boxes that take 4 numbers each?

  • @famHouse18
    @famHouse18 Před 5 měsíci +1

    sir please make video on portfolio website using react

  • @asadmehboob1300
    @asadmehboob1300 Před 5 měsíci

    If we want to past 4 digits from email or phone no?

  • @xdotaku5182
    @xdotaku5182 Před 4 měsíci

    I didn't try it, so correct me if I am wrong. If we are using "tab" button to move b/w components, the "onClick" won''t trigger. So maybe we should run the cursor positioning function on "onFocus"?

  • @DastageerHC
    @DastageerHC Před 5 měsíci

    I was asked this question last month,

  • @_sarthakmisal
    @_sarthakmisal Před 5 měsíci

    How is onOtpSubmit still working even after you declared it again with const

  • @Gymaurcode
    @Gymaurcode Před 5 měsíci

    Bro make videos on RTK query and redux toolkit

  • @user-dd7kw3ym5i
    @user-dd7kw3ym5i Před 5 měsíci +1

    this is a smaller code to only focus first input element, put this on attribute "autoFocus={index == 0}" 🤓

  • @nileshsangle4946
    @nileshsangle4946 Před 4 měsíci

    nice one sir

  • @goshmain982
    @goshmain982 Před 4 měsíci

    love you

  • @nikitarawat953
    @nikitarawat953 Před 4 měsíci +1

    onKeyDown event is not working as expected. when i click backspace, the cursor still remains on the same input and when i again click backspace it goes to the previous input and automatically delete that otp. Instead, onKeyUp works perfectly fine in my code. why this happening?

    • @nishanbangera9349
      @nishanbangera9349 Před 3 měsíci

      I am facing the same problem...have u rectified the reason for that bug?? If yes please tell me

  • @sandiss1210
    @sandiss1210 Před 4 měsíci

    guys how can i get thier animated background

  • @debaprasadbehura968
    @debaprasadbehura968 Před měsícem

    bhai esa laga ki jaise tune ye sab kahan se rata mar ke ayae tha baise likh diya jo kar raha hai samjahana cahiye tha na bas likhe ja raha hai yar
    btw good content or code already present in geeks for geeks

    • @RoadsideCoder
      @RoadsideCoder  Před měsícem

      bhai iss video ko follow karne se pehle apko react js aani zruri hai, else u wont understand the code.

    • @ffgameing8936
      @ffgameing8936 Před měsícem

      ​@@RoadsideCoderBhai react padha hun main
      Mujhe app PE koi doubt nehi Hain bus ya bol Raha ti app ne pura geeks for geeks copy kar diya
      Apne kuch neya nehi samjhaya isiliye bola ye Mera alag I'd hai
      But thanks to this video
      It helps me know a lot of things ❤❤❤❤❤

  • @ultragamersvk1668
    @ultragamersvk1668 Před 4 měsíci

    WHY DON'T YOU USE TAILWIND CSS?

  • @Lucifer-xt7un
    @Lucifer-xt7un Před 5 měsíci +19

    Sir please bring a complete machine coding course please there are no one who are dealing this in complete market

    • @RoadsideCoder
      @RoadsideCoder  Před 5 měsíci +6

      Releasing Soon. 🔥
      Join here to be updated - discord.gg/2ecgDwx5EE

    • @Lucifer-xt7un
      @Lucifer-xt7un Před 5 měsíci +2

      @@RoadsideCoder may i know any tentative time line for course launch pleasee

    • @RoadsideCoder
      @RoadsideCoder  Před 5 měsíci +5

      1st week of feb most probably

    • @Lucifer-xt7un
      @Lucifer-xt7un Před 5 měsíci +1

      @@RoadsideCoder exciteddd🥳🤩🔥

    • @nisargbarot1998
      @nisargbarot1998 Před 5 měsíci

      ​Nnn@@RoadsideCoder

  • @_sarthakmisal
    @_sarthakmisal Před 5 měsíci

    Bhai console close Kara Karo recording ke time

  • @arpankumar4176
    @arpankumar4176 Před 5 měsíci +1

    make a video on form validation

  • @dasarimanoj3086
    @dasarimanoj3086 Před 5 měsíci

    When we gave the condition of phone number length to be < 10 then why is it allowing us to type random number more than 10? Shouldn't we throw an alert?🤔

    • @RoadsideCoder
      @RoadsideCoder  Před 5 měsíci

      we are saying lenght>10 not less, just as an example.

    • @ajaymalviya.7
      @ajaymalviya.7 Před 3 měsíci

      The length should be exactly 10 and having only 0-9 in regex isn't correct validation, but that logic 000000000 will also be a valid number. Indian numbers start with 6-9 or 0 (044) in case of landline numbers.

  • @TooJoo77
    @TooJoo77 Před 4 měsíci +1

    HomeWork answer :
    const value = e.target.value;
    if (value && idx < length - 1 && inputRefs.current[idx + 1]) {
    inputRefs.current[OTP.indexOf("")].focus();
    }

    • @theofficialleaker2495
      @theofficialleaker2495 Před 4 měsíci

      its too long bro just do
      if (index >= 0) {
      inputref.current[otp.indexOf("")].focus();
      }

    • @guptasagar694
      @guptasagar694 Před 3 měsíci

      @@theofficialleaker2495 Kaha se chalega ye, Question kya he aur tu bata kya raha he, agar kisi input field jo empty ho uspe directly jana he

  • @kishirisu1268
    @kishirisu1268 Před 5 měsíci +1

    I thought he will code full API and auth logic, but nope…
    Main problem he solved - how to move cursor from one input to another and check valid number. Probably it is enough for Indian coders 😂

  • @arjunjadhav3062
    @arjunjadhav3062 Před 5 měsíci

    i am trying to book your call but not happening actually money deduct ho gaya he do baar but call booked nahi huva.

    • @RoadsideCoder
      @RoadsideCoder  Před 4 měsíci

      Please contact me on instagram @roadsidecoder with the screenshot

  • @_sarthakmisal
    @_sarthakmisal Před 5 měsíci

    Bro theme kaunsi hai

  • @AshikRahman-fw3sv
    @AshikRahman-fw3sv Před 5 měsíci

    💚💚💙💙💖😍😍

  • @theofficialleaker2495
    @theofficialleaker2495 Před 4 měsíci

    Home work Answer ;
    do it inside onclick
    if (index >= 0) {
    inputref.current[otp.indexOf("")].focus();
    }

  • @pkam5690
    @pkam5690 Před 3 měsíci +1

    Hey, that's my number..

  • @ZainRamzan-pt8cm
    @ZainRamzan-pt8cm Před 5 měsíci

    Brother don't wast time on building such UI from scratch you can use the thirld party libraires .

    • @RoadsideCoder
      @RoadsideCoder  Před 5 měsíci +1

      In interviews you wone be allowed to use third party packages

  • @technicalgautamnangla2594
    @technicalgautamnangla2594 Před 5 měsíci

    Sir ye fresher interview question h kya experience

    • @RoadsideCoder
      @RoadsideCoder  Před 5 měsíci

      both

    • @technicalgautamnangla2594
      @technicalgautamnangla2594 Před 5 měsíci

      @@RoadsideCoder sir web dev kr rakha h pr job nhi mil rahi h .
      Portals pr try krte h scam call aati h and paise maangte h .. .
      Kuch btaao sir first job kaise le IT sector m

    • @guptasagar694
      @guptasagar694 Před 3 měsíci

      Nahi Mil paege..Kon si city me ho...Let me know, I will help@@technicalgautamnangla2594

    • @technicalgautamnangla2594
      @technicalgautamnangla2594 Před 3 měsíci

      @@guptasagar694 faridabad haryana

  • @aakashyadav6228
    @aakashyadav6228 Před 4 měsíci

    NGL, looked like you yourself were bit confused

  • @samarscript5824
    @samarscript5824 Před 4 měsíci

    33:49 Is there anyone here who has done the work I came specifically for?

    • @guptasagar694
      @guptasagar694 Před 3 měsíci

      Yes Bro,
      if (value && inputRefs.current) {
      for (let i = index + 1; i < length; i++) {
      if (!inputRefs.current[i].value && inputRefs.current[i]) {
      inputRefs.current[i].focus();
      break;
      }
      }
      }

  • @AlgoIT__
    @AlgoIT__ Před 5 měsíci

    Unnecessary give one input box y u need 4 I never understood

    • @RoadsideCoder
      @RoadsideCoder  Před 5 měsíci

      hahah, because this is the convention of an OTP Input

  • @Upsc2029-hy6ey
    @Upsc2029-hy6ey Před 4 měsíci

    fun fact: mobile number will go viral.

  • @guptasagar694
    @guptasagar694 Před 3 měsíci

    To be honest, i foillowed this tutorail but the logics opf moving inside the OTP field, I didnot get any logic, Didnot understand a word...What to Do, Please help

  • @mattakalyan1427
    @mattakalyan1427 Před 5 měsíci

    best video at final I tried with this logic inputRef.current[newOtp.indexOf("", index)].focus(); and it worked I just want to compare with your logic @roadsidecoader

  • @khomrajacharya6480
    @khomrajacharya6480 Před 5 měsíci

    Please make a video on form validation