Java Collection Interview Questions & Answers | Tricky Q&A | Freshers | Experience | JavaTechie
HTML-код
- Опубликовано: 4 окт 2024
- In this tutorial we will discuss Java Collection frameworks frequently asked interview questions and answers with Example , all the topics we will cover in upcoming tutorial
#javatechie #CoreJava #Interview #QA #Collection
GitHub:
github.com/Jav...
Blogs:
/ javatechie4u
Facebook:
/ 919464521471923
guys if you like this video please do subscribe now and press the bell icon to not miss any update from Java Techie
Disclaimer/Policy:
--------------------------------
Note : All uploaded content in this channel is mine and its not copied from any community , you are free to use source code from above mentioned GitHub account
I've been on a streak watching your tutorials for my interview prep, you are really helping a lot in quickly brushing up and also learning new concepts. More power to you...!!
Just completed watching 😊. Whoever reading the comments section, pls watch his interview question collections videos without having second thought. You will get many questions in interview for sure. Sharing this with my personal interview experience.
Thanks Nandni
Watch full collections interview questions here part 10 to 15.....
this video covered all the key questions asked in interview. Please create these interview questions video more oftenly.
Everyone need this whether fresher or experience, Good Work and Content.
Basant sir, please start series on data structures and algorithm, its a humble request. Please
totally we need this
hi basant, just adding one thing here, if we use java 8 then no need to write custom code for sorting , checking multiple values,
System.out.println("");
System.out.println("name and salary basis in java 8");
Collections.sort(list, Comparator.comparing(Employee::getName).thenComparing(Employee::getSalary));
for (Employee e : list) {
System.out.println(e);
}
checking one value,
System.out.println("salary basis using stream");
list.stream().sorted(Comparator.comparing(e -> e.getSalary())).forEach(System.out::println);
@Basant Sir, thank you for providing such an in-depth explanation in simple ways.
57:53 we are just seeing treemap linearly. but it is not the actual way. treemap entry looks like below: static final class Entry implements Map.Entry {
K key;
V value;
Entry left;
Entry right;
Entry parent;
boolean color = BLACK;
} what is color black here, what does left,right,parent doing.
One of the best interview videos ever seen for Java.
Excellent job. Thank you.
It would nice help if you could make some video related to DSA which are mostly asked during the interview for all kind of technical postions in Java.
Thanks for the video. Concurrent HahMap is not Synchronised. ConcurrentHashMap in Java is indeed thread-safe, but it achieves this without using traditional synchronization mechanisms like locks. Instead, it uses a different approach called "lock-striping" and "compare-and-swap" operations to allow concurrent access from multiple threads without blocking them unnecessarily.
Great tutorial brother. But i believe, for normal hashmap lock will not be applied on whole collection. Lock will be applied on whole collection in synchronised hashmap . And as u rightly said segment wise locking in concurrent hashmap
Anyways you doing a great job with interview playlist in helping so many IT people get jobs during this boom😄
Thanks allot for clear explanation ..I have gone through your and Durgesh sir video's ...And I am very confident about comming interview...
Why are you so underrated , the content is just so professional and to the point, I Wish that you get more views and likes for your ahead uploads
Thank you buddy for well wish 🤞
So far the best and crisp, as it's not just tells theory..it's with example. Great job 👍
Hi basant , great content could you please post Q&A for spring and spring MVC and boot all together with the practical example , it would be more helpful candidates like me .. thanks
Microsevice also
Yes sir..
Would be helpful
Tusar and hacks I will do this .after saga pattern video
most beneficial video, all concepts cleared. Will surely recommend
Thanks Sir.. Very much helpful in preparation.. Concepts are quite clear and proven
Thankyou so much for the video brother learnt a lot , in tree map internal implementation would be binary search tree i think.
I generally do not comment on any youtube videos...but this tutorial is so good that i cracked 10+ interviews in just a shorter span of 1 month and got hike of more than 150%.Thanks a lot..and keep uploading such videos for iinterview preparation.
Thanks buddy 😀. Glad to know this
very very very nice and helpful interview questions .In no other videos i have seen this good content .this helped me a lot in my interviews.
Keep learning buddy ☺️
Hello, in CopyOnWriteArrayList - can you print the elements again at the end after coming out of while loop as System.out.println(list); That should print the elements in the list including new elements added at the end from the copied list newly created.
Another point here is, the iterator supports to delete an element using remove() in case of an ArrayList, though it does not support to add any new element to that. I believe remove() also works in similar concept - creates another copy of original list.
Thank you so much , it is a much needed videos for all job seekers 🙏🙏🙏🙏
Basant Sir, first of all, I have no words to thank you. You are really doing a great job by sharing this invaluable knowledge and experience with us. However, one small doubt - if Set uses Wrapper class like String, Integer it doesn't allow duplicates. Only for custom classes we need to override equals() & hashcode().
Yes that's correct because all wrapper classes by default override equals and hashcode method
Sir your teaching is vary helpful ,, videos are very important.
Please make one single video on spring boot interview questions.
Appreciate your efforts , thanks for the good job, invaluable contribution to the community.
This was ultimately awesome👏✊👍
Thanks a lot🙏🙇
Waiting 4 nxt vdo...😊🇮🇳🙏🌻👏👏👌👌
Great tutorial on Collections Framework interview questions, very informative, thank you!
Really love you sir...got few offers due to your valuable teaching 😍😍
Thank you kishore
First i thought this is going to be the same as always like difference this with this & difference this with that blah blah sh*t, but I'll say this is best Q&A ever of collection. Thank you sir
Thanks buddy 😌
Thank you so much.
Very helpful. Pls make more this type vdos on spring,springboot,jpa,hibernate etc
Good job !! Ur video helped to understand quickly about collections 👍
Hi basant, could you please create videos on multithreading and executor framework with examples.
very clearly explained,waiting for more in this series
Well explained. I especially liked the Hashmap explanation with diagram
Good job,the way of approach is good i.e theory and then code.keep it up
Thanks buddy 😊
Please upload video on multi-threading tricky questions which asked in interview.
just subscribed !!!😊for sharing the source code and material
tnx a lot
Basant sir, I think even there is no guarantee of showing modification as output by ConcurrentHashMap, it depends upon which segment are modified as Iterator is forward moving cursor & cant go back.
Now suppose, during iteration if we update or added some segment values where iterator had already visited earlier, now ConcurrentHashMap wont able to display those values. In our example, Entry may be added at later segment than Entry and Entry thus its showing in output as Iterator able to access it. 🙏
The Video is very nicely explained.
You are indeed Java Techie sir, Crisp explaination.. 🙌
great work brother.....make video on multithreading as well....and other spring and spring boot
Awesome explanation and you design a course structure is excellent
Thanks Srikanth 😊
Thanks for the vedio. Request you to do one AWS EKS microservices deployment .(with 2 services which you created in early vedios)
Excellent coverage of topics. Please make on spring core (same bean name,type) etc.
Yes I will
wow sir sir please go through all interview question of java sir we are waiting for your video sir
U rocks again.
Please make one video of Multithreading interview qustions for more than 5years experienced , in youtube hardly to find any tututorials
Thanks buddy these questions also asked in 8+ experience person
@Javatechie for collection I have following this one or I can say , to start any new topic I would search your videos first that much believe we people have becoz addition to core concept u are also including project examples which helps us to form scenarios in interview😊
Thank you so much Aman for following Javatechie and appreciate your word 🤗
Hi Javatechie, Thank you so much. Your videos have really helped in my interview prep, I have 2 job offers now
Your videos are informative and really useful
Cool buddy. Good to hear this
Great tutorial for quickly brushing up on concepts before interviews. Thank you!
Very nice explanation and thanks for the information about the interview questions. Is it possible to make video on all datastructures
Jordar video ❤
Dear JavaTechie Very good awesome videos
Great tutorial for quick recap of concepts
Great work , Thanks a lot
Thanks buddy
Just woow!!! Great content..keep it up man
very good set of questions covered .. Thanks for the video ..!!
Amazing explanation thank you.
Basant sir,your content very informative Thank you. please make video on spring spring boot and microservice interview questions and answers.
I will
your content is always best sir
You explained excellently
Watch full collections interview questions here part 10 to 15.....
In case of hashmap there is no lock of thread, that means any thread can access it.
Yes but the locking mechanism won't allow multiple threads to play with a single map obj
42:47 note there can only be 1 entry with key=null, however, there may be several entries having value = null
Please make one video on multithreading interview questions in java (Future vs CompletableFuture)
Okay
Please make video on spring and microservice interview questions
sir naya sikhane ko mila ..
Good one... as usually very well crafted explanations.
Thanks Avishek
Hi basant ,at 40:20 u mentioned that due to thread acquire lock on whole map so we get concurrent modification but i have a doubt that since hashmap is not thread safe how can it acquire lock..please let me know
very well explained Techie✌✌✌
amazing lecture sir....
44:44 Collections.synchronizedMap(map) and synchronized HashTable both does not have segment level locking mechanism.
If we put any value in map it will generate the hashcode and on that hashcode that particular value will be set right. What if the value or key is null at which index it will be save?
It will go to 0 index
@@Javatechie ok thanks
super content and nice explanation, could you please explain how Get method works internally in Hashmap
Superb ❤
33:41 CopyOnWriteArrayList never checks modcount. So On difference of modCount, it never creates the cloned copy. I think when we created the iterator at that time it created a cloned copy for iteration.
No it check modcount I opened source code and verified it .
@@Javatechie public E next() { // this is for CopyOnWriteArrayList
if (! hasNext())
throw new NoSuchElementException();
return (E) snapshot[cursor++];
}
This is for ArrayList:
public E next() {
checkForComodification();
int i = cursor;
if (i >= size)
throw new NoSuchElementException();
Object[] elementData = ArrayList.this.elementData;
if (i >= elementData.length)
throw new ConcurrentModificationException();
cursor = i + 1;
return (E) elementData[lastRet = i];
}
15:20
is it this way that if we use Set Object with Wrapper Class of primitive data type then it doesn't store duplicate.
But just in case of custom object it stores duplicate objects.
(just verifying that for Wrapper Class it doesn't store duplicates right?)
Thank you very much sir🙏🙏🙏
Good content. please upload Multithreading interview questions as well.Thank You!
I will
This guy deserves a like
Nice content keep it up ....
awesome explanation sir thank you so much sir ❣ sir which company you are working in ?
hi sir this is very good video and helpful also but give more questions about collections and also create new video on spring and springboot interviews questions also its also very helpful
Yes I will
hi Sir , can we get the interview questions and answers for Multithreading , i will be verymuch helpful
Okay i will
Basant sir great content 🔥🔥🙏
Gurug. Thanks a lot
Nice explaination
Superb bro, thanks
Please create internal implementation of collection , like how it internal works..
Sir requesting you to make a video on the programs asked based on arrays,string,lists,sarching and sorting mechanisms
Sayan yes I will
Watch full collections interview questions here part 10 to 15.....
Thanks @Sayan
automation testing also will
ask same
way
hashmap vs treemap who can find the entry quickly, considering all entries are with unique key
15:15 usage of equals and hash code method
Wrapper classs of set also doesn’t allow duplicates right?
Wrapper class of set ?
@@Javatechie u told that while using with custom and wrapper classes need to handle explicitly for duplicate check
@@kumarrajakotakonda1351 if you add Custom class without override equals and hashcode method then set will allow duplicate .
@@Javatechie custom class will allow duplicate but wrapper classes doesn’t allow but u said wrapper classes also will allow duplicate in vedio
My mistake
TreeMap and TreeSet both follow "Balanced Tree/Red-Black Tree concept", as hashMap is following from java 8 onwards. Thanks anyway 🙏🙏
40.50 can you explain it again? you said that "ConCurrentHashMap allows multiple threads to access map object simultaneously". If multiple threads access the same object simultaneously, then it is not thread safe any more
My bad , based on his locking mechanism multiple thread can access without concurrent exception
Nice Video as always good contents.
Watch full collections interview questions here part 10 to 15.....
Amazing content ❤️
Hi Sir,
It was a really useful video. In the end, you mentioned that you will cover few more collection interview questions on next video.
Can you please share the link of that video?
I will do that
@@Javatechie sir pls share the link of the next video...thanks
@@kshitijbansal3672 i have not upload yet buddy
I am eagerly waiting for spring boot and Restful questions
are you planing to prepare Interview Questions for Spring?
Yes buddy
Excellent
Great as always 👍🏽