Frontend javascript mock interview | Ep. 4

Поделиться
HTML-код
  • Опубликовано: 30 окт 2024

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

  • @SurajKumar-kb3fw
    @SurajKumar-kb3fw 19 дней назад +2

    11:40 When we access a variable or function before its declaration it is called hoisting and thus we'll see error, and also hoisting acts different for ( Let and Const ) Declaratives for example DTZ ( Dead Temporal Zone ).

  • @08_tanmaybhansali2
    @08_tanmaybhansali2 Месяц назад +1

    My solution for reversing the array question
    const arr=[1,2,3,4,5,6,7,7]
    function reverse(arr){
    let start=0
    let end=arr.length-1
    while(start

    • @SemicolonGuy
      @SemicolonGuy  Месяц назад

      Nice! Latest wale mock interview ka bhi solve krke dekho

    • @08_tanmaybhansali2
      @08_tanmaybhansali2 Месяц назад

      @@SemicolonGuy ok try karte hu aaj hi 👍 by the love your content ❤️

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

    17:55 Need to use === to compare datatypes too . Javascript for ya

  • @professor_01d
    @professor_01d 4 месяца назад +2

    Actually, reversing an array means overwriting the original array with its elements in reverse order, not just printing the elements in reverse on the console(i.e. traversing array from end), which is not acceptable even for freshers nowdays. I think you should have told about this in the video.

    • @SemicolonGuy
      @SemicolonGuy  4 месяца назад

      thanks for pointing this out. Well said!

  • @abhinavshinde5611
    @abhinavshinde5611 4 месяца назад +2

    let arr=[1,2,3,4];
    let rev=[ ];
    for (let num in arr){
    rev.unshift(num);
    }
    console.log(rev)
    Can we use this in the interview or the interviewer will just go deep in these concepts????

    • @SemicolonGuy
      @SemicolonGuy  4 месяца назад +1

      i wouldn't suggest using inbuilt functions for solving problems.
      You can't showcase your Problem solving skills with bunch of inbuilt functions.

  • @SalmanRaza-i7h
    @SalmanRaza-i7h 3 месяца назад +2

    Please try to zoom in the screen sometimes code is not visible or blurry

  • @TheNostalgiaDaily
    @TheNostalgiaDaily 3 месяца назад +4

    I would Just have used Bubble sort to reverse the array

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

      Simply use for loop and starts with length-1 and decrement - -

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

    for problem 1 can't we just stringify and replace it then parse it again?

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

    30:24 bhai.. ishne sirf array ko reverse print kiya hai..😂 Array reverse nahi hua.. array ko last index se print karne se array reverse ho nahi jata...😅😅... Learning = kabhi kabhi interview lene vale ko sab kuchha aata ho aesa jaruri nahi hai.. they also dont find the mistakes or error.. so jo aata hai vo bol dalo.. LinkList reverse karne ko bole and nahi aata toh Linklist ki tail se print karva do .. chal jayega 😂🤣🤣

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

      Nhi bhai esa nhi hai. Mujhe sirf approach dekhni thi Isliye aage continue krdia.
      Hmesha solution nhi dekha jaata hai

    • @DeepakSharma-ue3pn
      @DeepakSharma-ue3pn Месяц назад

      bhai linkedList ki valuues ko kese print krega tail se, usme backward pointers nahi hote uske liye doubly linked list chaiye hogi

  • @arrey-ettaekep850
    @arrey-ettaekep850 4 месяца назад +7

    function flattenObject(KeyValues, parentKey = "", result = {}) {
    for (let [key, value] of KeyValues) {
    let newParentKey = !!parentKey ? `${parentKey}_${key}` : key;
    if (typeof value === "object" && value !== null) {
    flattenObject(Object.entries(value), newParentKey, result);
    } else {
    result[newParentKey] = value;
    }
    }
    return result;
    }
    let obj = {
    a: 1,
    b: {
    c: 2,
    },
    c: {
    d: {
    e: {
    f: 3,
    },
    },
    },
    };
    let output = flattenObject(Object.entries(obj));

    • @SemicolonGuy
      @SemicolonGuy  4 месяца назад

      Object.entries function ke andar hona chhaiye

    • @iganic7574
      @iganic7574 2 месяца назад

      Yo don't need to convert object to key values its unnecessary and taking memory object keys can be directly iteratable throw
      for (const key in obj){
      Const value = obj[key]
      } Loop

  • @TooHarshh
    @TooHarshh 4 месяца назад +2

    Sir you look like purav jha 🗿

  • @CodeWithSumo
    @CodeWithSumo 4 месяца назад +4

    Mera bhi loo Bhai interview

    • @SemicolonGuy
      @SemicolonGuy  4 месяца назад

      form bhar do bhai

    • @CodeWithSumo
      @CodeWithSumo 4 месяца назад +1

      Mock form is no longer accept response 😞

  • @life-lessonn.
    @life-lessonn. 3 месяца назад +1

    eaa mugi tero interview gedaa jastho lagxa !