2 year experienced ReactJs Mock Interview | 🎉 Selected | ReactJs & JavaScript | Tier 2/3 college

Поделиться
HTML-код
  • Опубликовано: 6 июн 2023
  • #frontenddeveloper #mockinterview #interview #VasanthBhat #uncommonGeeks
    UncommonGeeks is a RUclips channel dedicated to helping candidates clear their interview. There are more than 100+ videos and new videos will be uploaded every week. If you're seriously preparing for interviews and looking for tips and tricks, please subscribe to my channel and press the bell icon.
    Join Uncommon Geeks community to discuss with other developers: t.me/uncommongeek.
    To talk to me one one one book a session here: topmate.io/vasanth_bhat
    Follow me on LinkedIn - / vasanth-bhat-4180909b
    Medium Blog / mevasanth
    JavaScript Interview preparation series : • Watch this series and ...
    JavaScript Custom implementation/polyfills Series: • Learn Custom implement...
    Interview preparation tips and tricks by Vasanth (play list): • Interview preparation ...
    Frontend system design series: • 🔥 What is frontend Sy...
    MAANG series for frontend developer: • First ever MAANG serie...
    Frontend mock interview series: • ReactJS & JavaScript M...
    Shorts for quick access to all frontend resources: • MAANG interview Qstns ...
    Tips for freshers: • Engineer Fresher Guidance
  • НаукаНаука

Комментарии • 79

  • @Pankaj-nr1pw
    @Pankaj-nr1pw 10 месяцев назад +2

    Good way to get insights about React interview. The way to ask and answer questions is amazing.

  • @AllAboutReactJs
    @AllAboutReactJs 2 месяца назад +3

    Your interviews are insightful, I would recommend answering the questions as well if its not answered correctly.

    • @careerwithvasanth
      @careerwithvasanth  2 месяца назад +1

      Noted your suggestion !! will try to do it, in future videos

    • @abhishekporwal876
      @abhishekporwal876 12 дней назад +1

      @@careerwithvasanth yeah please, correct the answer if candidate give wrong answer, it will be helpful to know us also when we are also think what could be the answer and candidate give wrong answer, we can match it with your answer.

    • @careerwithvasanth
      @careerwithvasanth  12 дней назад

      @@abhishekporwal876 Thanks for the comments!! if you checkout new videos on the same playlist I'm answering all the questions at the end !!ruclips.net/p/PLmcRO0ZwQv4SwXLVpnKb_nFQx1Wd2XEjD

  • @Jay_Patel2000
    @Jay_Patel2000 11 дней назад +1

    We can solve using the wrapper function to check the token is expired or not, we can simply create a guard auth file for check always token expire or not if we get incorrect response we can logout the user and redirect to the login page, I have implemented that with jwt token

  • @awais_ansarii
    @awais_ansarii Год назад +1

    ❣️

  • @qurashishebi7988
    @qurashishebi7988 8 месяцев назад +4

    I think we used axios interceptor to track the response of request and if it is failed then we need to automatically call another request to refresh token and then automatically call the original request and user don't know about that. So in that case user experience is also improved.

    • @careerwithvasanth
      @careerwithvasanth  8 месяцев назад

      How you're making everything "Automatic" ? can you elaborate ?

    • @qurashishebi7988
      @qurashishebi7988 8 месяцев назад

      @@careerwithvasanth actually interceptor is used to track the response of every request and if response status is 401 then we request on refresh token end point but failed request store and after refresh token we call it again

  • @user-kk1uq9ol1o
    @user-kk1uq9ol1o 4 месяца назад +1

    very good real life interview experiance

  • @anushasurakala5975
    @anushasurakala5975 3 месяца назад

    thankyou

  • @siddhartharaja9413
    @siddhartharaja9413 9 месяцев назад +1

    Great

  • @allindiachannel2290
    @allindiachannel2290 Год назад +1

    In the question of 3 api parallel call -> i think promise channing should be a solution first we check if the fisrt api call is resolved then return to next two unless go in the catch block

    • @careerwithvasanth
      @careerwithvasanth  Год назад

      Promise chaining is not parallel execution, it's a concurrent execution.

    • @allindiachannel2290
      @allindiachannel2290 Год назад +1

      @@careerwithvasanth Sir where can i read about parallel and concurrent execution of javascript? Can you give me the link?

    • @careerwithvasanth
      @careerwithvasanth  Год назад +2

      ​@@allindiachannel2290 Join our group here: t.me/uncommongeek you will get a community of people who can help you with all these !! open link from mobile phone after installing Telegram application.

  • @piyushpatil9359
    @piyushpatil9359 10 месяцев назад +2

    I have 2 approaches that i used...
    1) if it got status code in response 401 then I'll simple logout and tell user to login again with new token
    2) If there is a support of refresh token from Backend then I'll use axios interceptor...when i make parallel api calls and first time my token gets expire then that time i got some error for that api call...then I'll call another api using interceptor and get refresh token replace that token with my current expired one token and move forward with that refresh token...

  • @Nikhilkumar-yh7yc
    @Nikhilkumar-yh7yc 5 дней назад +1

    Promise.all will be used . it means if token get fail it will return the failure

    • @careerwithvasanth
      @careerwithvasanth  3 дня назад

      Promise.all will execute all promises in concurrent and the problem I asked cannot be solved by it.

  • @ambrishsukla3036
    @ambrishsukla3036 Год назад +4

    Question 3 - We can implement a function of refrshToken, wheich will check whether session is active or not, and based on that status we will execute other 3 api's.
    if status is true then 3 api will be called else getNewToken will be executed, and then will use new toekn for other 3 api's.
    Please Do let me know whether answer is corret or not?

    • @careerwithvasanth
      @careerwithvasanth  Год назад

      How to invoke refreshToken ? from each of the 3 API's or ?

    • @yuvraj5283
      @yuvraj5283 9 месяцев назад

      Can use axios and it's concept interceptor,
      What will happen is when acces token expired interceptor listens that acces token expired and after that it calls the refresh token api to get the new token and after all 3 api will call with new token.
      Interceptor.request
      Interceptor.response

    • @economics11th16
      @economics11th16 7 месяцев назад

      The same question asked to me, and I answered that I will create a separate function. But at that time I was not sure that it's a right way to do this or not but I was right.

  • @miw879
    @miw879 Год назад +10

    It would be better if you could answer the questions he was not able to give answer to anyways its a mock us audience will get to learn as well

    • @careerwithvasanth
      @careerwithvasanth  Год назад +2

      Miw, I too want to do that !! but video becomes lengthy, for any question you don't get the answer online, comment here. I will try to answer them !!

    • @miw879
      @miw879 Год назад

      @@careerwithvasanth great thanks we can start with how to make that prototype map function available across your entire app?

    • @vasu7370
      @vasu7370 Год назад

      @@miw879 exporting it and importing it

    • @miw879
      @miw879 Год назад

      @@careerwithvasanth still waiting for your reply sir

    • @careerwithvasanth
      @careerwithvasanth  Год назад

      @@miw879 Hi, sorry for late reply. Join our 1800+ member uncommon geeks telegram group here, you can discuss such queries there
      t.me/uncommongeek install telegram app on your mobile and click this link.
      I have less time to make video about it, but you can clarify all your doubts on this group.

  • @adityapundir6529
    @adityapundir6529 Год назад +3

    The myMap function can be exported and then can be imported wherever needed

  • @nikhilranjankumar6069
    @nikhilranjankumar6069 11 месяцев назад +1

    When we land on a website we check that we have fetch one api that tells about whether the user is logged in or not if the user is logged in then we definitely have the token else we logged out the user and prevent us to call another api.
    So like we have a social media web app so in this we will fetch the user profile where we get the token and save it to local storage ... If we have the Authorization token in then only we logged in the user else users have to log in again we can easily achieve this using the backend ....
    So now the other api call will depend upon if we have a profile or not ...
    So if we have a profile and we have the correct token and we proceed else the user has to login in again the token renew

    • @careerwithvasanth
      @careerwithvasanth  11 месяцев назад

      There are 2 things here, authorisation token and access token. Authorisation token will be present if user is logged in, where as access token will expire at some predefined interval. So user is logged in (as authorisation token is valid) but access token is expired. How do you handle that situation is my question !!

    • @shubhanshusahuu
      @shubhanshusahuu 27 дней назад

      ​​@@careerwithvasanth can send this access token to all the protected routes inside their headers,
      which needs to be called only when the access token is valid,
      On the backend they can verify that is access token is valid or not.

  • @adityapundir6529
    @adityapundir6529 Год назад +2

    If the first call succeeds, I'm gonna set the state to proceed for other calls, and in useEffect, if the state tells to proceed, I will. Else, I'm not gonna continue for those calls.

  • @abhishekkumarsingh5615
    @abhishekkumarsingh5615 5 месяцев назад +1

    Sir can you also give the answers to few of the questions. That will make us learn quickly.

    • @careerwithvasanth
      @careerwithvasanth  12 дней назад

      Thanks for the comments!! if you checkout new videos on the same playlist I'm answering all the questions at the end !!ruclips.net/user/playlist?

  • @kalashnikov203
    @kalashnikov203 11 месяцев назад +1

    Sir can u please explain the solution to prevent parllel api calls in case of expired tokens problem , Not able to find the answer anywhere not even in telegram channel, especially to prevent other two api calls after the initiation of first api call, most the solutions are for preventing all the api calls but not after first api call since they run in parallel all are initiated one after other without waiting for the result of first api call.

    • @Dhirajkumar-fb3to
      @Dhirajkumar-fb3to 3 месяца назад

      Bro as i think promise have some methods for this like promise.All(api1,api2,api3) which give all the resp. For the condition that even 1 will give the resp it's race() ,is settled() 4-5 methods are there i think this one of them will be use here

  • @SanjayYadav-ur4qj
    @SanjayYadav-ur4qj 6 месяцев назад

    Since you are making API requests parallelly. How can you check that the first call has failed and now I have to put the second call in the queue meanwhile the token is being refreshed? Both will make requests to the server simultaneously (approx.) and will be failed.

    • @abhishekdharamkar5294
      @abhishekdharamkar5294 5 месяцев назад

      if api call fail due to expiration of token then it should redirect to login page and empty the localstorage

  • @sanchitasuryavanshi674
    @sanchitasuryavanshi674 10 месяцев назад +1

    Solution for 15:00 use async await

  • @Dhirajkumar-fb3to
    @Dhirajkumar-fb3to 3 месяца назад

    Bro useReducer make it more complex, it's for heavy complex state Mangmt altr of useState if you want to use useReducer go with the redux, .. It's have smiliar syntax of that

    • @Dhirajkumar-fb3to
      @Dhirajkumar-fb3to 3 месяца назад

      May be im wrong but sallow copy malfunctuonality will help here to change the original object if you like to do so.. Or if you want to create new obj go with the deep copy..

  • @yogeshchaurasiya8915
    @yogeshchaurasiya8915 7 месяцев назад +2

    Can please share candidate resume.

  • @thirukumaran7294
    @thirukumaran7294 Год назад +1

    can we use any interceptors so that if the token error showed up , then we can cancel other 2 apis??

    • @careerwithvasanth
      @careerwithvasanth  Год назад

      That's partially right !! but how to you handle re-calling those 2 API's ??

    • @thirukumaran7294
      @thirukumaran7294 Год назад

      @@careerwithvasanth dont have any idea bro, please spit it from ur mouth 😃

  • @MrPurpleBOT9547
    @MrPurpleBOT9547 9 месяцев назад +1

    I think we could do that token question with maintaining redux or usecontext api
    We will check for token expiry for all apis and when we got valid token then we will maintain it in context and we will check for that context before hitting api if we get false for that context we can hit the api or we will return it with some response
    Please share your thoughts on this solution it would be really appreciated 🙏

    • @careerwithvasanth
      @careerwithvasanth  9 месяцев назад +1

      How do you handle the requests that are not processed because of token expiry ? how to re-trigger it ?

    • @MrPurpleBOT9547
      @MrPurpleBOT9547 9 месяцев назад

      @uncommongeeks okay for that i am maintaining the context in boolean when the first requests hit and git the error of token expiry i will set the context to true and when i got the data from that requests i will set the context value to false and i will put a check on top for every query to first check the context value before hitting the request.

    • @MrPurpleBOT9547
      @MrPurpleBOT9547 9 месяцев назад

      If the context value is false then we could go for the next step of hitting api

    • @MrPurpleBOT9547
      @MrPurpleBOT9547 9 месяцев назад

      Share your review on this

  • @nallaparajuamareshvarma8471
    @nallaparajuamareshvarma8471 Год назад +2

    Can any one tell me where to place the poly fills folder in react.js

    • @careerwithvasanth
      @careerwithvasanth  Год назад

      Generally people don't create polyfills in ReactJS project. They just use utilities to do the required functionalities

  • @bandaumamahesh9346
    @bandaumamahesh9346 3 месяца назад +1

    Sir can you please suggest any good books for learning frontend developer

    • @careerwithvasanth
      @careerwithvasanth  12 дней назад

      Hi, Join our 3100+ member Career with Vasanth telegram group here, you can discuss things like this and a lot of opening related information is also shared here: t.me/uncommongeek

  • @syedimam1998
    @syedimam1998 Год назад +4

    At 13:38
    How about using token refreshing with a lock mechanism?

  • @hello_Subham
    @hello_Subham 10 месяцев назад +1

    Hello sir I m interested in a mock interview I have knowledge of frontend technologies.

    • @careerwithvasanth
      @careerwithvasanth  10 месяцев назад +1

      Follow me on LinkedIn www.linkedin.com/in/vasanthbhat/
      Join our telegram group here t.me/uncommongeek
      Message me in either of the two(Preferably telegram) and we can connect for a mock interview..

  • @fardeenmalnas3203
    @fardeenmalnas3203 Год назад +2

    17:05 can we use cookies to store user auth token then check using if else condition if user auth token is expired then do 1 api call
    Else do all 3 api call

    • @careerwithvasanth
      @careerwithvasanth  Год назад +1

      How to do handle parallel API calling ??

    • @fardeenmalnas3203
      @fardeenmalnas3203 Год назад +2

      @@careerwithvasanth we can use promise.all() for parellel api calls.
      Please correct me if i am wrong

  • @omkarjagtap2212
    @omkarjagtap2212 8 месяцев назад +1

  • @sohanYT69
    @sohanYT69 9 месяцев назад +1

    if (isTokenExpired(authToken)) {
    return refreshAuthToken()
    .then((newToken) => {
    // Now we have the new token, make the parallel requests
    return Promise.all(
    urls.map((url) => fetchWithToken(url, newToken))
    );
    });
    } else{
    return Promise.all(
    urls.map((url) => fetchWithToken(url, newToken))
    )}}
    isnt this the ryt way? or am I missing something?

    • @careerwithvasanth
      @careerwithvasanth  9 месяцев назад

      If you can add code sandbox link that would be easy to validate

  • @manojkumarsahoo1905
    @manojkumarsahoo1905 9 месяцев назад +1

    I think we can do by promise.race

    • @careerwithvasanth
      @careerwithvasanth  9 месяцев назад

      Can you please add the code snippets ? appreciate your comments.