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

Поділитися
Вставка
  • Опубліковано 20 сер 2024
  • #frontenddeveloper #mockinterview #interview #VasanthBhat #uncommonGeeks
    UncommonGeeks is a UA-cam 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/vas...
    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

КОМЕНТАРІ • 81

  • @AllAboutReactJs
    @AllAboutReactJs 3 місяці тому +4

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

    • @careerwithvasanth
      @careerwithvasanth  3 місяці тому +1

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

    • @abhishekporwal876
      @abhishekporwal876 2 місяці тому +2

      @@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  2 місяці тому

      @@abhishekporwal876 Thanks for the comments!! if you checkout new videos on the same playlist I'm answering all the questions at the end !!ua-cam.com/play/PLmcRO0ZwQv4SwXLVpnKb_nFQx1Wd2XEjD.html

  • @qurashishebi7988
    @qurashishebi7988 10 місяців тому +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  10 місяців тому

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

    • @qurashishebi7988
      @qurashishebi7988 10 місяців тому

      @@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

  • @Jay_Patel2000
    @Jay_Patel2000 2 місяці тому +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

  • @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.

  • @piyushpatil9359
    @piyushpatil9359 Рік тому +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...

  • @Pankaj-nr1pw
    @Pankaj-nr1pw Рік тому +2

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

  • @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.

  • @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 11 місяців тому

      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 9 місяців тому

      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.

  • @Nikhilkumar-yh7yc
    @Nikhilkumar-yh7yc Місяць тому +1

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

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

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

  • @Prince-yz1tc
    @Prince-yz1tc Місяць тому

    I'll have a variable to set if any api call fails. If it fails, i'll cancel out the parallel calls made to rest two calls.

  • @nikhilranjankumar6069
    @nikhilranjankumar6069 Рік тому +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  Рік тому

      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 2 місяці тому

      ​​@@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 Рік тому +3

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

  • @user-kk1uq9ol1o
    @user-kk1uq9ol1o 6 місяців тому +1

    very good real life interview experiance

  • @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.

  • @Dhirajkumar-fb3to
    @Dhirajkumar-fb3to 4 місяці тому

    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 4 місяці тому

      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..

  • @abhishekkumarsingh5615
    @abhishekkumarsingh5615 7 місяців тому +1

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

    • @careerwithvasanth
      @careerwithvasanth  2 місяці тому

      Thanks for the comments!! if you checkout new videos on the same playlist I'm answering all the questions at the end !!ua-cam.com/users/playlist?

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

    Solution for 15:00 use async await

  • @yogeshchaurasiya8915
    @yogeshchaurasiya8915 9 місяців тому +2

    Can please share candidate resume.

  • @MrPurpleBOT9547
    @MrPurpleBOT9547 11 місяців тому +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  11 місяців тому +1

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

    • @MrPurpleBOT9547
      @MrPurpleBOT9547 11 місяців тому

      @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 11 місяців тому

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

    • @MrPurpleBOT9547
      @MrPurpleBOT9547 11 місяців тому

      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

  • @kalashnikov203
    @kalashnikov203 Рік тому +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 4 місяці тому

      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

  • @syedimam1998
    @syedimam1998 Рік тому +4

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

  • @siddhartharaja9413
    @siddhartharaja9413 11 місяців тому +1

    Great

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

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

    • @careerwithvasanth
      @careerwithvasanth  Рік тому +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..

  • @bandaumamahesh9346
    @bandaumamahesh9346 4 місяці тому +1

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

    • @careerwithvasanth
      @careerwithvasanth  2 місяці тому

      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

  • @SanjayYadav-ur4qj
    @SanjayYadav-ur4qj 8 місяців тому

    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 6 місяців тому

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

  • @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

  • @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 😃

  • @anushasurakala5975
    @anushasurakala5975 4 місяці тому

    thankyou

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

    ❣️

  • @puneetmeena1893
    @puneetmeena1893 3 дні тому

    arvind bhaiya😂😂😂😂😂😂

  • @manojkumarsahoo1905
    @manojkumarsahoo1905 11 місяців тому +1

    I think we can do by promise.race

    • @careerwithvasanth
      @careerwithvasanth  11 місяців тому

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

  • @sohanYT69
    @sohanYT69 11 місяців тому +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  11 місяців тому

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

  • @omkarjagtap2212
    @omkarjagtap2212 9 місяців тому +1