01. Internal Working of HashMap & Java-8 Enhancement
HTML-код
- Опубликовано: 1 окт 2024
- #java #interviewquestions #webencyclop
In this playlist I will try to cover all the important java interview questions along with answers in very intuitive, kind of pictorial/animated way.
Complete Playlist:
• Java Developer Intervi...
Next Video:
• 02. Equals and HashCod...
Video includes:
- 00:16 What is internal memory structure of HashMap?
- 04:09 How HashMap "Map.put()" method works?
- 06:41 What is a Hash Collision?
- 08:37 What is the use of Object.equals() method in HashMap.
- 09:03 Summary of internal working of Map.put() method in HashMap.
- 10:35 How to search element in LinkedList
- 12:03 How HashMap "Map.get()" method internally works.
- 14:30 Why we need enhancement in Java 8 HashMap, what was the problem before?
- 15:03 Java 8 enhancement in HashMap, (storing elements from LinkedList into Tree structure)
- 15:15 What is treefy threshold in HashMap ?
- 18:08 What is red-black Tree in HashMap. Binary Search Tree or Self Balancing Tree.
In this series we will be covering all Java interview questions and answers. This is going to be comprehensive list of Java interview questions which can help experienced Java developers to prepare for an interview as well as upskilling the Java knowledge.
I would always recommend everyone to watch Durga Sir (durgasoft) videos because of extensive in depth explaination on all topics if you have more time.
But here we will try to cover important aspects of Java Programming which are always asked in interviews withing less time.
We will be covering below topics in the video.
1. Hashmap Interview Questions
2. Hashmap Java 8
3. Hashmap Java Coding interviews
4. Hashmap in Java by Durga
5. Hashmap Java Interview Questions
6. HashMap internal working
7. equals-hashcode
8. get method
9. hashmap in java
10. internal-working-hashmap
11. interview-questions
12. java 8
13. java tutorial
14. java-8-nehancement
15. put method
16. job interview questions and answers
17. behavioral interview questions and answers
18. job interview tips
19. Interview questions and answers
20. Animated java
21. java animation
22. java programming tutorial
23. Hashmap java 8
24. learn java
25. java tutorial for beginners
26. Hashmap enhancements in Java 8
you said that the capacity will be increased if 12 buckets will be full (for initial capacity = 16), but if i try to use class, which hashCode() always returns 1, as a key, then all the new pairs will be stored in one bucket with index 1 and according to debugging the capacity will still be increased. doesn't this mean that the load factor depends on the number of pairs in the hash map? not on the number of buckets with pairs
ah good catch, let me pin 📌 this post. thanks for your comment.
thank you for your comment! good point!
nice observation, thanks for sharing this
Is loadfactor depending on number of entries in Hashmap? @webencyclop (if not what is the meaning of pairs here? what does this pair signify?)
@@dhanashreekamali3185key and value😊
Your pictorial representations, the images & the color that's choosen for slides, the way you have explained it so neatly, its commendable. You have simplified a tough concept and making complex things look simple is an art. Great job. Good going!
Thanks a lot for praise & motivation!
@@ankit.wasankar Please upload more videos ... Very much helpful. Thanks.
Agree.
Superb.... you are the best.... god bless you
🎯 Key Takeaways for quick navigation:
00:00 *Interview question introduction*
00:13 *Creating new jobs*
01:10 *Subscribe for updates*
02:22 *Journey components*
03:49 *Multiple nodes concept*
05:09 *Hash code importance*
06:47 *Calculating values*
08:51 *Node equality check*
10:35 *Item searching process*
12:29 *Time complexity overview*
14:13 *Notification system*
15:11 *Tree conversion process*
16:04 *Web content benefits*
16:28 *Tree structure benefits*
16:52 *Search optimization method*
17:23 *String comparison methods*
17:58 *Red-black tree definition*
18:11 *Binary search tree*
18:29 *Tree conversion process*
18:49 *Future interview questions*
Made with HARPA AI
if hashmap size reaches above load factor i.e(3/4) of initial size than it will double the size of hashmap in such case it will rearrange key or not because size of hashmap is increased.please clarify on this point
Yes, ,it will do re arrangment. It's an expensive operation.. This process also called as rehashing.
Nice explanation. But only request is, don't repeat "ok" everytime.
Hashmap bucket intex start from 0 to 15 . But you mentioned 1 t 16
Plz make full collection type video ur way of represente slide in pictorial way is wonder full .keep it up......
Thanks for the explanation. It was very helpful
Beautiful explanation with specially the images...felt very comfortable to understand...Keep going...Thankyou!
Kindly note that when hashmap is passed the duplicate key, it calls the hashCode() method to generate the hash value for the key and this hash value helps in determining where to put this new entry but since this index/position already has one entry. Since each bucket stores the entry/ies in the form of a linked list so new entry will be added at the top/right end of the linked list. The same logic will be applied if another duplicate key arrives. Please note, when we try to retrieve the value by passing the key(which is duplicate in nature), hashmap goes to the appropriate index by calculating the hash value and traverses the linked list, and returns the most recent value as all the keys are same.
Best explanation for hashmap. Thanks!
The way he represents the data is phenomenal...
Thums up for his presentation. 👍👍👍
Best Representation, Really helpful, request to you please create video on "Internal working of HashSet"...
Just awesome.....Thanks you sir!
Thank you sir. You are excellent.
crystal clear explaination👌👌👌
One of the best tutorial …. Thank you
Picturial representation makes this videos excellent... It will be easy to remember the flow chart
Excellent video on Hashmap so far, keep doing more like this.
best video on HashMap internal working and loved your content.thank you for such great content.😊
Best explanation so far in youtube on hashmap internal working... Nice buddy!! Appreciate your effort ...
Amazing explanation👍👍
very good explanation.
Hey your core java interview series is very helpful.. I wish you continue doing many more topics in this.
Awesome Explanation
Awesome Explanation
One word... "AWESOME"
All is best ....very nice
Great explanations. Thanks !! Please keep making more videos. Nice way of teaching.
Thanks from a user from Viet Nam
Your explanation was so easy to understand although it's hard to understand your english as much :)
Tried a lot on the internet to understand hashmap working ... finally brother understood from your video👍👍👍
Excellent explanation.
best explaination ❤❤❤
10:38 java 8 enhancement
Excellent explanation
Thank you so much..
Very nice, love it
Wow, you explained it so well, I have watched so many tutorials for this concept and never had this deep understanding. Thank u so much.
Mast Bhawa
Hi sir ,The way your explanation is spoon feeding, if we see screenshot at the end we get all the details about hashmap .
I would request create some sessions about springboot .
1.springboot security (authentication: Authorization)
2.springboot transaction
a.what is the purpose of transaction and etc
3.what is different b/w jdbc/spring jdbc /hibernate/spring data jpa
4.spring xml vs spring boot
5
Really nice!
Thanks Bro
Hi sir,
In your video u used integer value as we are converting from linked list to Tree structure. The no greater than root element is place above and smaller place below.
But in HashMap they are not number they are also object. Because collection stores only object. Please clarify? I am confused
Correct. I intentionally used Interges because we can easily compare them instead of object. In java we compare objects using natural ordering or implementing Comparable .. U can try with objects as well but then u need to use compare methods for getting order in which they should appear
superb explanation ,it cleared the concepts.Kindly post the multiple thread and design pattern concepts of java
very neatly explained basics of working of hashmap,linkedlist,tree
if key is 8 than how will insert is it will rearrange ?
Yes.. it's self balanced that means it will rearrange
Thank you
You are awesome at explaining complex topics. Thank you.
Good job 👍
Starting index of bucket 0 or 1 ?
zero
Awesome.
Best Explanation ever…have seen so many videos but this is the best, Thank you 🙏
excellent
Thank you sooo much because of your this video i understood the internal working of hashmap after so many days. Nice explaination...🙏🙏
Just superb explanation. Could you please make tutorial on some LinkedList and Tree programing concepts. TIA
Super
that summary work flow is awesome.... it help much better than your whole explanation
You are LEGEND man! The way you explained I can answer hashmap even after death :D
Well documented video. Thanks
It was a nice explaination..easy to understand👍...Please upload a video on internal working of hashet..
great video sir. One doubt, what is the value for treefy threshold? and can we modify it?
TREEIFY_THRESHOLD=8 and NO, we cannot change the default value
How can we put the entry in the bucket index like 12, is there any method like map.put(12, "key", "value") ?
Wow, what a prefect explanation it was.
Thanks a lot man for this smooth explanation,
We're looking forward for many videos, but you have stopped posting it.
A great explanation ,one of the best video till now i watched on Hashmap internal...Thank you for sharing a such content😊
Thank you so much for this video I was actually able to visualise internal structure of the hashmap
thankyou so much. its really excellent explanation with neat slides, think your the best tutor to explain the concept in a simplified manner. I think its the best video on hash map .
I have seen many videos but I am wasn't satisfied with any of them .After seeing this video I got an absolute clarity thanks to this man for explaining in such a detailed way.
Please Upload more videos.....your explanation is just awesome👌👌👌😍
Perfectly done. But I have one question, in the node you are placing both and values but that's not possible right.
Thank you for the explanation. It's really helpful.
Using compareTo() method what goes below & above in case of a String value?
Best video on working of Hashmap . Also the treeify threshold concept is well explained. Thank you!!
Amazing explanation. Thanks. Please prepare some more videos.
Really aprreciate the hardwork. Cn you please make a playlist of all java collections and their internal working.
Excellent content & presentation. Eagerly waiting for the new videos. Please keep up the good work!!!
Appreciated the way you explained the concept. Thank you.
You explained this concept in detail, this is very helpful... thank you!!
Explained very well. Thank you :)
Awesome❤️
You are awesome you explained it so clearly your animation are awesome great work .. You should be in udemy not on youtube .. Impressed with your work ..
Thank u for explaining in such a wonderful way. Before watching this video I have lot of confusion in this topic. This clear my all doubts.
Bhai Kya explain Kiya hai..Thank you so much...Can you please create video on ConcurrentHash map, Difference between Hashmap, Synchronized Hashmap and Concurrent hashmap
On the way😊
I have never seen such detailed tutorial about the hashmap! I want to thank you, even I knew how it works.
V good explanation, simple and on point. Thanks and Keep making more videos like this!
Thanks for the wonderful explanation.
Wow. Well explained the concept with practical example👏 And Thank you for the clear explanation. Your channel deserves more subscribers
Very precise explanation.Thanks a lot
Bro, one of the best video I've seen. Proper explanation , diagram. 🔥
Sir your teaching is so good and simple and so effective...
wow so easy to understand. I like how you actually explain certain keywords instead of grazing over concepts. this was so helpful thank you!
Extraordinary explanation pls make more videos in this playlist
Thanks so much. It's very helpful for me.
your explanation is great . try to make more videos on java .
Thanks, man thanks a lot finally my concept is cleared, One of the best explanation I got on youtube
This is not enough for the interview. What if custom object is used a key without implementing comparator ? How the tiebreaker works when hash collision occurs ? how get method works ?
Yeah.. agree. Didn't except people are really going that deep. Because most of interviewer aren't aware of these concepts. But yeah I guess I should have included that.
I can create another video on the tieBreakOrder and identityHashCode when actual tree building starts in treeifyBin.
Thanks for the comments!! 😊
Tysm for simply explanation... I have seen much vdo bt this is the best vdo.. Tq once again..🙏🏻
If you can, please go through my description & give a star to my repo. It'll be very helpful to me. Thank you ✌️
This is really great explanation, thanks
Very good explaining not able to find anywhere else
Best tutorial I have ever seen. Thank you.