Concurrent Collection Interview questions and Answers for experienced and freshers | Code Decode

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ก.ค. 2024
  • This video contains Concurrent Collection Interview questions and Answers for experienced and freshers Candidates.
    Udemy Course of Code Decode on Microservice k8s AWS CICD link:
    openinapp.co/udemycourse
    Course Description Video :
    yt.openinapp.co/dmjvd
    Concurrent collection IQ Part 2 : • Java Tricky Concurrent...
    Concurrent collection is a very important topic in terms of collection interview questions and answers for experienced and answers
    Q) Difference between Synchronized Collection and Concurrent Collection?
    Both Synchronized and Concurrent Collection classes provide thread-safety
    The differences between them comes in performance, scalability and how they achieve thread-safety.
    Synchronized collections like synchronized HashMap are much slower than their concurrent counterparts e.g. ConcurrentHashMap, Main reason for this slowness is locking;
    What is the need of concurrent collection
    Traditional collections are not thread safe. only few classes like Vector, HashTable are thread safe.
    Collections provide some methods like synchronizedList, synchronizedMap, synchronizedSet those provide thread safety but problem is they capture lock on complete collection even for reading that decreases performance.
    In traditional collection if one thread iterates and other tries to modify structural change then ConcurrentModificationException is thrown.
    Give few concurrent collections classes ?
    ConcurrentHashMap
    CopyOnWriteArrayList
    CopyOnWriteArraySet
    Why performance of ConcurrentHashMap is better than HashTable and synchronizedMap ?
    In HashTable and synchronizedMap lock is acquired on complete collection so only single thread can capture lock at a time while in ConcurrentHashMap lock is acquired on bucket level so at a time multiple thread can capture lock on different different bucket.
    Promotional Links
    Registration link: relvl.co/t6e
    upGrad(BD) relvl.co/tl2
    Urban Company(BD) relvl.co/zhu
    Vedantu(BD) relvl.co/ul4
    Curefit(BD) relvl.co/dw7
    Cred(FD) relvl.co/qke
    Digit(FD) relvl.co/g1c
    Razorpay(BE) relvl.co/tbl
    Yellow Messenger(BE) relvl.co/8gp
    Cred(BE) relvl.co/5kq
    1mg(BE) relvl.co/vqm
    Digit(BE) relvl.co/8m3
    Code Decode Playlists
    Most Asked Core Java Interview Questions and Answers : • Core Java frequently a...
    Advance Java Interview Questions and Answers : • Advance Java Interview...
    Java 8 Interview Questions and Answers : • Java 8 Interview Quest...
    Hibernate Interview Questions and Answers : • Hibernate Interview Qu...
    Spring Boot Interview Questions and Answers : • Advance Java Interview...
    Angular Playlist : • Angular Course Introdu...
    GIT : • GIT
    -------------------------------------------------------------------------------------------------------------------------------------
    Subscriber and Follow Code Decode
    Subscriber Code Decode : th-cam.com/users/CodeDecode?...
    Linkedin : / codedecodeyoutube
    Instagram : / codedecode25
    --------------------------------------------------------------------------------------------------------------------------------------
    #javacollectioninterviewquestion #topjavacollectioninterveiwquestion #javainterviewquestion #codedecode

ความคิดเห็น • 74

  • @akshayengineer2018
    @akshayengineer2018 ปีที่แล้ว +6

    This is the Best video on Concurrent HashMap on whole internet. We cant find such explanation anywhere else, Thanks alot Mam 😊

    • @CodeDecode
      @CodeDecode  ปีที่แล้ว

      Thanx Akshay 😊😊

  • @rituparnadeshpande3821
    @rituparnadeshpande3821 2 ปีที่แล้ว +4

    This is the best video on CHM so far... Every video of yours are clear, to the point and well structured.. You explain very well.. This is a very dependable channel.. Thank you

    • @CodeDecode
      @CodeDecode  2 ปีที่แล้ว

      Thanks Rituparna. This means a lot 🙂🙂👍👍. Thanks a ton 🙂

  • @suryadoynandan9684
    @suryadoynandan9684 2 ปีที่แล้ว +1

    Thank you so much for upolading such a useful videos...this is helping a lot to clear my logic

    • @CodeDecode
      @CodeDecode  2 ปีที่แล้ว

      Thanks Suryadoy. 🙂🙂👍👍

  • @sneharaghuwanshi4933
    @sneharaghuwanshi4933 2 วันที่ผ่านมา

    thank you so much for clearing all the doubts

  • @ILuvBilli
    @ILuvBilli 2 ปีที่แล้ว +1

    One important point you forgot to add that we can change legacy collections structure through iterator remove method.

  • @yoshitamahajan353
    @yoshitamahajan353 5 หลายเดือนก่อน

    is there any video for segmentation which u have made.. wanted for refernece

  • @sandeepgattu5690
    @sandeepgattu5690 2 ปีที่แล้ว

    Please provide the copyonwritearraylist internal working
    That will helps us more...

  • @PradipYogi59
    @PradipYogi59 2 ปีที่แล้ว

    Wonderful and really great video , can you please share me some good collection books . So I can refer
    And please make more video on OOPS and collection

  • @prinkpalsingh5028
    @prinkpalsingh5028 2 ปีที่แล้ว +2

    Really helpful.
    Can you please make part2 of concurrent collections

    • @CodeDecode
      @CodeDecode  2 ปีที่แล้ว

      Sure Prinkpal 👍👍🙂🙂

  • @kumaraditya9986
    @kumaraditya9986 ปีที่แล้ว

    Please make a video on why null are not allowed on concurrent hashmap.

  • @lohitharg621
    @lohitharg621 ปีที่แล้ว

    If one thread is accessing the value then on the same bucket other thread cannot modify right then how will it return null?

  • @muralir6768
    @muralir6768 2 ปีที่แล้ว +1

    Nice and expecting more videos like this

    • @CodeDecode
      @CodeDecode  2 ปีที่แล้ว

      Sure Murali 🙂👍

  • @shankardayal6928
    @shankardayal6928 2 ปีที่แล้ว

    As for read ,there is no lock.
    Then say s0 is locked for writing then why does reading not allowed in s0?

  • @Iam_Raam
    @Iam_Raam 2 ปีที่แล้ว +2

    Hi, why won't we get ConcurrentModificationException if we are iterating through ForEach loop and updating map during iterating..?

    • @CodeDecode
      @CodeDecode  2 ปีที่แล้ว

      Can you please give a snapshot of your code so that we can explain you

  • @rishiraj2548
    @rishiraj2548 ปีที่แล้ว +1

    👍

  • @hemantanahak5674
    @hemantanahak5674 2 ปีที่แล้ว +2

    KIndly Please share the program to understand the concurrent hashmap where it is not allowed null and concurrency level program as well with bit more explanation.

    • @CodeDecode
      @CodeDecode  2 ปีที่แล้ว

      Sure we will do that Hemanta 👍👍🙂🙂

  • @madanmohanpachouly6135
    @madanmohanpachouly6135 2 ปีที่แล้ว +1

    Clear explanation .. Thanks

  • @venkatb8317
    @venkatb8317 2 ปีที่แล้ว +1

    Yes please make video thanks in advance

  • @iloradas6387
    @iloradas6387 2 ปีที่แล้ว +2

    Great explaination but can you please explain modcount concept in a bit more detail

    • @CodeDecode
      @CodeDecode  2 ปีที่แล้ว

      Sure llora we will do that👍👍

  • @DilaGurung
    @DilaGurung 2 ปีที่แล้ว

    I didn't get the fact since ambiguity is not allowed so concurrent hashmap does not allow null value. But why is hashmap allowing ambiguity.

  • @pvc7995
    @pvc7995 2 ปีที่แล้ว +1

    Make some real time projects mam and how to integrate front end and back-end .. And deployment of project and bug fixing concepts pls

    • @CodeDecode
      @CodeDecode  2 ปีที่แล้ว

      Sure Thulasi 👍👍

  • @venkatsai2541
    @venkatsai2541 2 ปีที่แล้ว +1

    Program why null not allows in concurrent hashmapcode while allowed in hashmap please explain by debugging code

  • @nagireddy1507
    @nagireddy1507 ปีที่แล้ว +1

    Great explanation...

  • @Iam_Raam
    @Iam_Raam 2 ปีที่แล้ว +1

    If we are iterating through forEach, we will not get ConcurrentModificationException but we will get if iterate through iterator, why ?

    • @ShinAkuma
      @ShinAkuma 2 ปีที่แล้ว

      You are creating an Iterator reference before using it. So while you're traversing the Map and changing it, your Iterator reference is still the old one which was created using the Map which had lesser values.

  • @viji6131
    @viji6131 2 ปีที่แล้ว +1

    Hi. Can u pls make a video on hibernate pls cover n+1 problem and cache concepts pls

    • @CodeDecode
      @CodeDecode  2 ปีที่แล้ว +1

      Very nice topic viji. Will create video on that very soon.

  • @sharvarirg984
    @sharvarirg984 5 หลายเดือนก่อน

    Ma'am, You have mentioned t2 can't do read or write on segment 1 at 10:50 . But at 17:00 you said read can happen anywhere, segment does not matter. I'm confused. It would a great help if you help me understand.

    • @pavithraakp2067
      @pavithraakp2067 4 หลายเดือนก่อน

      Read doesn't need any lock. One thread is writing on a segment at a time another thread can read that same segment. Last update value will be returned by get() method.

  • @venkataraghava3173
    @venkataraghava3173 2 ปีที่แล้ว +1

    very nice explanation

    • @CodeDecode
      @CodeDecode  2 ปีที่แล้ว

      Thanks Raghava🙂👍

  • @vickybhoir3017
    @vickybhoir3017 2 หลายเดือนก่อน +1

    nice explaination

    • @CodeDecode
      @CodeDecode  2 หลายเดือนก่อน

      Thanks 😊

  • @smitchaudhari9783
    @smitchaudhari9783 ปีที่แล้ว

    Hello Mam if null is not allowed the it suppose thread1 is checking so we have lock on that segment then how can thread2 delete it so there can’t be the case where null means thread2 deleted it hence null should be allowed?

    • @ashish7516
      @ashish7516 ปีที่แล้ว

      Thread1(first one) is just reading, so no lock will be acquired. Hence the second thread (the one writing) can come and delete the value.

  • @samyishere2382
    @samyishere2382 2 ปีที่แล้ว +1

    Mam can you please make video on tricky interview questions of OS🙏

    • @CodeDecode
      @CodeDecode  2 ปีที่แล้ว

      Sure we will plan and upload it soon

  • @shijipaul2
    @shijipaul2 2 ปีที่แล้ว +1

    Can you please add one video on deployment process

    • @CodeDecode
      @CodeDecode  2 ปีที่แล้ว

      Sure Shiji 👍👍

  • @patnalajahnavi1680
    @patnalajahnavi1680 4 หลายเดือนก่อน

    Can u explain reentrant lock clearly

  • @dpkpk1573
    @dpkpk1573 2 ปีที่แล้ว +1

    Nice explanation....

    • @CodeDecode
      @CodeDecode  2 ปีที่แล้ว +1

      Thanks 🙂👍

    • @dpkpk1573
      @dpkpk1573 2 ปีที่แล้ว +1

      @@CodeDecode if possible please also make a Video on creating Custom annotations in java....

    • @CodeDecode
      @CodeDecode  2 ปีที่แล้ว +1

      Nice topic , yes we will create one🙂🙂👍👍

  • @tulasiramsunkara
    @tulasiramsunkara 2 ปีที่แล้ว +1

    Can you create a separate video to explain concurrency level

    • @CodeDecode
      @CodeDecode  2 ปีที่แล้ว

      Sure Tulasi 👍👍

    • @tulasiramsunkara
      @tulasiramsunkara 2 ปีที่แล้ว

      @@CodeDecode Thank you for considering

  • @dhirajbibekar2944
    @dhirajbibekar2944 4 หลายเดือนก่อน

    Please create and upload part 2

    • @CodeDecode
      @CodeDecode  4 หลายเดือนก่อน

      Sure we will create one soon

  • @premamalar8550
    @premamalar8550 2 ปีที่แล้ว +1

    Mam in 13.26 timing.. In that slide t1 check the condition and t2 delete the key u said that na.... My question is t2 for delete operation is our assumption?? Is it correct mam??

  • @venkataraghava3173
    @venkataraghava3173 2 ปีที่แล้ว +1

    can you please exp about semaphore

  • @venkatsai2541
    @venkatsai2541 2 ปีที่แล้ว +1

    Please cover array list

    • @CodeDecode
      @CodeDecode  2 ปีที่แล้ว

      Sure Venkat 👍👍

  • @Ravikumar-gj6qw
    @Ravikumar-gj6qw 2 ปีที่แล้ว

    create a video at time 13:25

  • @kazaasekhar
    @kazaasekhar 2 ปีที่แล้ว +1

    we don't have chance to give more than one like otherwise my likes count will be one thousad for every videos...

    • @CodeDecode
      @CodeDecode  2 ปีที่แล้ว

      This means a lot Sekhar 🙏🙂👍👍👍👍

  • @geekaffairs6475
    @geekaffairs6475 2 ปีที่แล้ว +1

    👍