Find Duplicate Elements from list using Java 8 | Java 8 coding Interview Questions | Code Decode

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

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

  • @manognajoshik8465
    @manognajoshik8465 2 года назад +27

    And yeah, I could clear all the interviews I faced because of you. What more is needed to say you made my career? Thanks a lotttttttt..As a quote goes, donating money to someone may prove helpful to him at that point of time but helping someone earn will help him for lifetime and this is what you are doing. Many thanks..

    • @CodeDecode
      @CodeDecode  2 года назад +4

      This comment made my day Manogna. Many congratulations to you for your interviews 👏👏🙂🙂. Well deserved 👏👏👏👏👏👏. Thanks a lot for being with us.

    • @ArtAndCraftsByNirvi
      @ArtAndCraftsByNirvi 2 года назад +1

      hi

    • @rushikeshgodase8498
      @rushikeshgodase8498 2 года назад

      You were fresher or experienced at the time of interview.

  • @varunb2453
    @varunb2453 2 года назад +4

    Hi , Thank you very much 😊 because of you I cleared 3 MNC interviews.

    • @CodeDecode
      @CodeDecode  2 года назад +1

      Well deserved Varun. Many congratulations 🎉🎉🎊🎊🎊👍👍keep shining Man 🎊🎊🎊🎊

    • @rishabhsharma5690
      @rishabhsharma5690 2 года назад

      Which all?

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

    Yesterday I was able to watch another of your incredible videos, but today, it feels like I am witnessing a fragment of the past, when parents were screaming at me because I don't get stuff. I need a calmer version of this.

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

      So sorry if you feel so Man. We apologies for this. We will try to be more calmer and composed. Thanks for pointing it up

  • @rishabhsharma5690
    @rishabhsharma5690 2 года назад +4

    Thanks mate. By watching your videos i was able to clear 2 out of 3 interviews and got offer. ❤️ And respect for you ma'am

    • @CodeDecode
      @CodeDecode  2 года назад

      Many congratulations Rishabh 👏👏👏👏well deserved Man 👏👏👏🎊🎊. Thanks a lot 🙏

  • @shoebahmadkhan531
    @shoebahmadkhan531 2 года назад +3

    I was checking videos for rest APIs and landed on your video from there this is my 7th or 8th video of yours. Continuously watching as all of the concepts are explained very well with practical and all are very interesting. I did not even get bored. Thank you so much mam for teaching us. Please make a video of a spring boot project from the start.🤍

    • @CodeDecode
      @CodeDecode  2 года назад

      ruclips.net/p/PLyHJZXNdCXsdXxY8wupiLenux2Yafn1lN

    • @CodeDecode
      @CodeDecode  2 года назад

      Thanks Shoeb 🙂👍

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

    mam tussi great ho...... continue grt work .....tq so much and lots of love.

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

    Earlier I was not that clear with the implementation of groupingBy() but this video is a gem, which helped me to understand the usage and implementation.
    Thanks for creating such wonderful content.

  • @AbhishekSingh-jt9fn
    @AbhishekSingh-jt9fn 2 года назад +1

    You are the best..nice explanation..keep it up.🙂

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

    I have a question in(video 5:41)
    Unique and duplicate names.
    I obesrved unique names output. It was wrong because "code" is repeated unique names output and duplicate names output. I want a solution for this. I faced difficulty in an interview. If possible please answer ASAP.

  • @manojpatil2457
    @manojpatil2457 2 года назад +1

    Liked even without watching ,😁.
    Your content is awesome...

    • @CodeDecode
      @CodeDecode  2 года назад

      Thanks a lot Manoj 🙂👍

  • @swapnilmishra697
    @swapnilmishra697 2 года назад +2

    Very well explained ...thanks for covering a problem in different ways

    • @CodeDecode
      @CodeDecode  2 года назад

      Thanks Swapnil🙂🙂👍👍

  • @saraswathig7939
    @saraswathig7939 7 месяцев назад +1

    Amazing content. 4 days to go...for the interview. Thank you❤

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

      All the very best for interview

  • @ahishnar1568
    @ahishnar1568 2 года назад +1

    Great work ❤️🙏

  • @sivamurthypala5426
    @sivamurthypala5426 2 года назад +1

    Your explanation is very well.

  • @bhuvanakuppusamy6933
    @bhuvanakuppusamy6933 2 года назад +1

    Clearly explained. Thanku so much

    • @CodeDecode
      @CodeDecode  2 года назад +1

      Thanks Bhuvana 🙂👍

  • @tannubajpai4782
    @tannubajpai4782 2 года назад +1

    u ar awsm ma'am

  • @arungpurohit7436
    @arungpurohit7436 2 года назад +1

    This is my first comment and i really appreciate you mam for spending ur time and posting some good content thank you for that

    • @CodeDecode
      @CodeDecode  2 года назад

      Thanks for supporting us Arun . Much appreciated. Thanks a lot🙂🙂👍👍

  • @rohiniravi104
    @rohiniravi104 2 года назад +1

    Hi, ur videos were really helpful to me in cracking interviews.

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

    explained very nicely.keep posted..

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

    Thank you 😊

  • @hrajiv29
    @hrajiv29 2 года назад +1

    Excellent coverage on Duplicate elements, Thanks for such a nice explanation.

  • @rajashekar-bu8xd
    @rajashekar-bu8xd 2 года назад +1

    Good one, keep making videos like this..

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

    Thanks 😃

  • @sayanbiswas8847
    @sayanbiswas8847 2 года назад +1

    Very helpful. Thanks for this.

  • @sharish1818
    @sharish1818 2 года назад +1

    Thank so much for helping us

    • @CodeDecode
      @CodeDecode  2 года назад

      Always there Harish 🙂🙂👍👍

  • @brrachana330
    @brrachana330 2 года назад +1

    Thankyou for all your java related imp questions and answers it is really helping me for interviews☘️

  • @abhinavmishra9690
    @abhinavmishra9690 2 года назад +1

    Very nicely explained and covered three to four concepts. Thanks 🙂

  • @travelwithgattu
    @travelwithgattu 2 года назад +1

    You are awesome 👍. Cracked 2 interviews only watching your videos 😘😘

    • @CodeDecode
      @CodeDecode  2 года назад +1

      Awesome Sayali. Well deserved girl. Keep learning keep shining ⭐✨⭐✨⭐✨⭐✨🎊🎊🎉🎉🎉

  • @ajitpeshane8311
    @ajitpeshane8311 10 месяцев назад

    Nice Series, on the Interview Questions and I am feeling Self Confident to crack the interviews.
    Specially the Java 8 programs, I was lacking in that, these videos made my life easy..
    Many thanks to Code Decode.
    Keep creating the content, it is very useful..

  • @manognajoshik8465
    @manognajoshik8465 2 года назад +1

    Mam, I have gone through your Microservices videos too. Not sure if I missed something but I need Resilience4j features including bulkhead. Very much addicted to your videos. Now it feels like I can understand things from no other resource but yours. Please make a video on entire Resilience4j.

    • @CodeDecode
      @CodeDecode  2 года назад

      Nice topic Manogna sure we will create videos on microservice design pattern 🙂👏

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

    Brilliant!

  • @islamiyazindagi6178
    @islamiyazindagi6178 2 года назад +1

    Very well explained mam..
    Could u plz help me to get 2nd part of this video ...

  • @shraddhawagh9480
    @shraddhawagh9480 2 года назад +1

    Hi Mam ..I am big fan of yours the way you explained is really awesome . When I watch your videos and then go for interview interviews it really really impress the panel which were sitting in front me.
    One suggestion mam the slide which you were explaining can you add it in comment section so that I can refer that slide at the time of interview at the end moment like notes.
    And also mam please make project on Springboot, angular, mysql or oracle DB if possible microservice also add whole concept in one project. It will really helpful for us..
    Thank you so much Mam

    • @CodeDecode
      @CodeDecode  2 года назад +1

      Awesome Shraddha. Many congratulations on successfully clearing interviews. Yeah we are planning to give ppt In a way that wont harm us and help you too. Currently we will face copyright issues if shared directly that's why we are trying ways

    • @shraddhawagh9480
      @shraddhawagh9480 2 года назад +2

      @@CodeDecode also mam please make project on Springboot, angular, mysql or oracle DB if possible microservice also add whole concept in one project. It will really helpful for us..

    • @CodeDecode
      @CodeDecode  2 года назад +1

      Nice suggestion Shraddha. Sure we will do that 🙂🙂👍👍

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

    3 Approach
    1. Using add() method of Set to verify the element is already present or not.
    2. Using groupingBy() method.
    3. Using frequency() method of Collections class.

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

    Too good

  • @javier.alvarez764
    @javier.alvarez764 2 года назад +1

    Can you do a video on Event Driven Architecture and also Kafka?

    • @CodeDecode
      @CodeDecode  2 года назад

      Sure we will create video on that soon 🙂👍

  • @apurvabagdiya
    @apurvabagdiya 2 года назад +2

    Hi, Can you please make a tutorial video on basics and how to use streams in Java 8🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻

    • @CodeDecode
      @CodeDecode  2 года назад

      ruclips.net/p/PLyHJZXNdCXsdeusn4OM33415DCMQ6sUKy
      Here we have all tutorial from basics too 🙂👍👍

  • @varunb2453
    @varunb2453 2 года назад +1

    Hi , One of the interview question as shown below:
    Suppose we have List => (id,name,salary,city).
    Now we need to get the unique list based on Name or salary etc, pls let us know the different ways to achieve it.
    Thank you.

    • @rushikeshgodase8498
      @rushikeshgodase8498 2 года назад

      i dont understand the question. Name or/and salary?

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

      Use comparator interface and sort it based on salary or name

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

    Can u plz make video on implementation explanation of hld with example plz...as its askd in interview

  • @Parni_Stories
    @Parni_Stories 2 года назад +1

    Hi Mam,
    Can you please cover any one of the Nosql DB?
    Thanks in advance

    • @CodeDecode
      @CodeDecode  2 года назад

      ruclips.net/video/DuYDUBydRL4/видео.html
      Here u go Anuradha. This may help u. 🙂👍

  • @shubhamkhandelwal7220
    @shubhamkhandelwal7220 2 года назад +1

    Because of you I am getting offer letters 😅

    • @CodeDecode
      @CodeDecode  2 года назад

      It's your hard work that's paying off Shubham. Well done 🎉🎉🎉🎉keep learning keep shining ⭐✨⭐✨⭐✨⭐✨

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

    @CodeDecode in line 71, we dont need filter function, just adding into set will remove duplicates. But anyways i learn and enjoy your videos thanks

  • @realnileshpawar
    @realnileshpawar 2 года назад +2

    Mam what is -> operator.
    Please make a separate video

    • @CodeDecode
      @CodeDecode  2 года назад

      ruclips.net/p/PLyHJZXNdCXsdeusn4OM33415DCMQ6sUKy

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

    I love your videos.. How can i know the sequence to read for java8. Can you help me with a link or any way how i can know the videos to start with followed by the next as i dont see numbering

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

    Could you do one video on only maps in collection

  • @karishmarawat1359
    @karishmarawat1359 2 года назад +1

    Awesome content as always!
    Please keep on creating more coding questions using java 8.
    Also, Can you please upload playlist on Dropwizard java framework as well just like you did for spring boot.
    Truly appreciate your efforts :)

    • @CodeDecode
      @CodeDecode  2 года назад

      Sure Karishma thanks 🙂🙂👍👍

  • @swapnareddy4938
    @swapnareddy4938 2 года назад +1

    Hi
    We have two lists l1 n l2 with some integers.
    How to print unique elements by comparing two lists.could please tell

    • @amarthyaseshu683
      @amarthyaseshu683 2 года назад +1

      U can add those 2 list elements in 1 list & convert to set I think

    • @chandugaddam4985
      @chandugaddam4985 2 года назад +3

      List list1 = new ArrayList(Arrays.asList(1, 2, 3, 4, 5, 4, 3));
      List list2 = new ArrayList(Arrays.asList(1, 3, 4, 6, 10));
      Set uniqueElements = new HashSet(list1);
      uniqueElements.addAll(list2);
      uniqueElements.forEach(System.out::println);
      Hope it helps

    • @swapnareddy4938
      @swapnareddy4938 2 года назад

      @@chandugaddam4985 using stream and lamda

    • @swapnareddy4938
      @swapnareddy4938 2 года назад

      @@amarthyaseshu683 using streams and lambda

    • @chandugaddam4985
      @chandugaddam4985 2 года назад +3

      @@swapnareddy4938
      List list1 = new ArrayList(Arrays.asList(1, 2, 3, 4, 5, 4, 3));
      List list2 = new ArrayList(Arrays.asList(1, 3, 4, 6, 10));
      List uniqueElements = Stream.concat(list1.stream(),list2.stream()).distinct().collect(Collectors.toList());
      uniqueElements.forEach(System.out::println);
      Hope it helps :)

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

    Buddy, Can you please explain how Function.identity() is taking the name as its key.?

  • @TheFebruary10
    @TheFebruary10 2 года назад +1

    How do you compare data from an excel sheet with db data

    • @CodeDecode
      @CodeDecode  2 года назад +1

      Convert excel sheet data to java Dto Or pojo. Then u can easily compare it with db entity. 🙂👍

  • @b.vishnuvardhan3704
    @b.vishnuvardhan3704 Год назад

    in the first approach as you mentioned finding duplicate and unique elements at a time having a issue in the explanation
    you cant find unique and duplicate element in one go why because
    lets take an example you are holding two strings "code" and "code" which means those are duplicate while adding first time to the list it will add to unique element and second time it will add to duplicate element list so hence it was duplicate element naa so how can we say it is a unique element also

  • @mit1696
    @mit1696 2 года назад +1

    I want a super like button for this channel 😀

    • @CodeDecode
      @CodeDecode  2 года назад

      Haha. Thanks a ton for supporting us 🙂👍

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

    Before giving all this, say that ypu can just add the List, into the SetList constructor method, Java will convert into Set automatically and discard all the duplicates, but if your interviewer wants a stream solution, you can show the ones from this video.

  • @shubhamkhune3132
    @shubhamkhune3132 2 года назад +1

    Hii kshitija mam😍

    • @CodeDecode
      @CodeDecode  2 года назад

      Sorry for disappointment Shubham, but who is Kshitija?

    • @shubhamkhune3132
      @shubhamkhune3132 2 года назад

      @@CodeDecode what is your name

    • @shubhamkhune3132
      @shubhamkhune3132 2 года назад +1

      @@CodeDecode your name is kshitija.😍

    • @CodeDecode
      @CodeDecode  2 года назад +1

      Again sorry for disappointment Shubham. It's not true. And we can't reveal us bcz we all are working IT professionals. Our jobs will come to stake if we did that. But yes can say, none of us is Kshitija here in our team code decode.

    • @shubhamkhune3132
      @shubhamkhune3132 2 года назад

      @@CodeDecode ,😍

  • @richyou8206
    @richyou8206 2 года назад +1

    Hi, can you pls share this spring boot crud project github or video link please

    • @CodeDecode
      @CodeDecode  2 года назад

      Ohh actually we removed the code while giving demo. Will try to push code to git.

    • @richyou8206
      @richyou8206 2 года назад

      @@CodeDecode thanks 🙏

  • @naadhsharyticha
    @naadhsharyticha 2 года назад

    Very well explained..thank you so much ma'am
    But,
    In First way, as you said we can get unique elements too.. but it's not the case as for first time when "code" comes it will get added to uniqueNames set and second time it restricts..so we need to add further logic for unique elements

    • @kolleparaakarsh5415
      @kolleparaakarsh5415 2 года назад

      Pass the list in set constructor. it filters. Automatically and gives unique values. Or collectors.toset also works.

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

    //Please explain how to Write Java 8 program to return word as a list value and its length as a key in descending sorting
    order from below sentence, -Input => String statement = "Hello World My name is Jane and I hate Mango Fruit";
    Output=> {5 = [“Hello”, “World”, “Mango”, “Fruit”], 4 = [“name”, “Jane”, “hate”],
    3 = [“and”], 2 = [“My”, “is”], 1 = [“I”]}

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

      Pseudo code :
      Split string by space, create list from array of string.
      Open stream on list
      Group by string's length n values will become list of all strings of that length👍

    • @sivalokesh3997
      @sivalokesh3997 10 месяцев назад

      String str="Hello Hi Hower yu";
      String[]s= str.split(" ");
      Maphm=Arrays.stream(s).collect(Collectors.groupingBy(String::length,TreeMap::new,Collectors.toList()));
      hm.forEach(
      (k,v)->{
      System.out.println(k);
      System.out.println(v);
      }
      );

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

      String statement = "Hello World My name is Jane and I hate Mango Fruit";
      String[] str = statement.split(" ");
      TreeMap ansMap = Arrays.stream(str).
      collect(Collectors.groupingBy(String::length, () -> new TreeMap(Comparator.reverseOrder()), Collectors.toList()));
      System.out.println(ansMap);

  • @testing12521
    @testing12521 10 месяцев назад

    First example explanation was too confusing maam ❤

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

    Can you plz share the github link

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

    Videos are very informative but the voice could be a bit calmer, it feels like someone is screaming in my ears !!!😅

  • @AmmarAlBalawi-o1b
    @AmmarAlBalawi-o1b 16 дней назад +1

    annoying

    • @CodeDecode
      @CodeDecode  16 дней назад

      Apologies 🙏 ammar al balawi

  • @venkatramanab7387
    @venkatramanab7387 2 года назад +1

    System.out.println(nameList.stream().collect(Collectors.groupingBy(String::new, Collectors.counting())));