Google Coding Interview Question and Answer #1: Zero Sum Triplets

Sdílet
Vložit
  • čas přidán 2. 05. 2019
  • Google Interview Question and Answer #1: Zero sum triplets.
    **** Best Books For Data Structures & Algorithms for Interviews:
    1. Cracking the Coding Interview: amzn.to/2WeO3eO
    2. Cracking the Coding Interview Paperback: amzn.to/3aSSe3Q
    3. Coding Interview Questions - Narasimha Karumanchi: amzn.to/3cYqjkV
    4. Data Structures and Algorithms Made Easy - N. Karumanchi: amzn.to/2U8FrDt
    5. Data Structures & Algorithms made Easy in Java - N. Karumanchi: amzn.to/2U0qZgY
    6. Introduction to Algorithms - CLR - Cormen, Leiserson, Rivest: amzn.to/2Wdp8rZ
    Programming Interview Questions.
    Zero Sum Triplets means finding 3 numbers from an array of integers whose sum is zero.
    #Google #Interview #Programming

Komentáře • 33

  • @KnowledgeCenter
    @KnowledgeCenter  Před 5 lety +1

    Share the videos if you like them. Knowledge Center has currently low number of subscribers.

  • @muskantomar6596
    @muskantomar6596 Před 3 lety +3

    I searched many videos but you way is best. Keep teaching

  • @Richard-lv9or
    @Richard-lv9or Před 5 lety +4

    Nice. Please add more Google interview questions.. :)

  • @learnjavaintelugu2751
    @learnjavaintelugu2751 Před 2 lety +1

    One of the best video i found for this problem, thanks a lot sir

  • @gavravdhongadi9824
    @gavravdhongadi9824 Před 3 lety +4

    The time complexity is n^2, right?

  • @pradeeshbm5558
    @pradeeshbm5558 Před 2 lety +1

    Great explanation. Thank you!

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

    Ok so the time complexity for this is O(n^2) is it.
    Here's what I've done
    Sorting the array like you've mentioned O(n log n)
    Iterating through each element in the array O(n)
    Inside the loop, Using the two pointers technique O(n)
    So the combined time complexity is O(n^2) due to the nested iteration and two pointers technique
    Therefore the overall time complexity is
    O(n log n)+O(n^2)=O(n^2)

  • @ghumakkad_yogi
    @ghumakkad_yogi Před 4 lety +1

    You are way of explanation awesome. I am jabra fan of u.

  • @MithunKumar-yo8lm
    @MithunKumar-yo8lm Před rokem +1

    Thanks for sharing.

  • @PrinceKumar-el7ob
    @PrinceKumar-el7ob Před 4 lety +1

    thanks sir for your help

  • @AbhinavKumar-dr4ef
    @AbhinavKumar-dr4ef Před 3 lety +1

    Nice Explanation

  • @nipunmadan1989
    @nipunmadan1989 Před rokem

    What will be the time complexity of the second approach?

  • @Abinashdash17
    @Abinashdash17 Před 3 lety +1

    Great explanation. Could you plz mention which IDE you are using?

  • @amitavamozumder73
    @amitavamozumder73 Před 3 lety

    this won't work for duplicates values, right?

  • @lakshmis5860
    @lakshmis5860 Před 3 lety

    Can you please make a cheet sheet for dsa for fang companies please

  • @AnuNedunuri-lw8ry
    @AnuNedunuri-lw8ry Před 3 měsíci

    These questions will be asked by Hyderabad Google company sir

  • @bobbuilder2837
    @bobbuilder2837 Před rokem

    You should add timestamp to each approach

  • @gustavomaia2252
    @gustavomaia2252 Před 9 měsíci +1

    Hi sir, this would be considered an easy or medium question for a google interview?

    • @KnowledgeCenter
      @KnowledgeCenter  Před 9 měsíci +1

      I think, Medium.

    • @gustavomaia2252
      @gustavomaia2252 Před 9 měsíci

      @@KnowledgeCenter Interesting, looks a quite simple for me, but maybe i just have enough practice in this kind of question.

  • @PradeepKumar-so5wq
    @PradeepKumar-so5wq Před 4 lety

    sir please explain any useful solution for k sum .. ie for 2,3,4

    • @KnowledgeCenter
      @KnowledgeCenter  Před 4 lety

      Can you explain the exact problem?

    • @PradeepKumar-so5wq
      @PradeepKumar-so5wq Před 4 lety +1

      @@KnowledgeCenter sir means same code is used for 4 sum with just little bit of modification.

    • @KnowledgeCenter
      @KnowledgeCenter  Před 4 lety +1

      Look at this: Subarray sum Equals K - czcams.com/video/YkacnIOt2jM/video.html
      Is it what you are looking for?