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 : kzitem.info?...
Linkedin : / codedecodeyoutube
Instagram : / codedecode25
--------------------------------------------------------------------------------------------------------------------------------------
#javacollectioninterviewquestion #topjavacollectioninterveiwquestion #javainterviewquestion #codedecode
Негізгі бет Concurrent Collection Interview questions and Answers for experienced and freshers | Code Decode
Пікірлер: 73