Java Collection Interview Questions & Answers | Tricky Q&A | Freshers | Experience | JavaTechie

  Рет қаралды 235,910

Java Techie

Java Techie

Күн бұрын

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

Пікірлер: 237
@nandinimani7084
@nandinimani7084 3 жыл бұрын
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.
@Javatechie
@Javatechie 3 жыл бұрын
Thanks Nandni
@OracleLand_Official
@OracleLand_Official 3 жыл бұрын
Watch full collections interview questions here part 10 to 15.....
@sreddy8141
@sreddy8141 3 жыл бұрын
Basant sir, please start series on data structures and algorithm, its a humble request. Please
@abhijitprusty
@abhijitprusty 3 жыл бұрын
totally we need this
@AnilKumar-dt3sq
@AnilKumar-dt3sq 2 жыл бұрын
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().
@Javatechie
@Javatechie 2 жыл бұрын
Yes that's correct because all wrapper classes by default override equals and hashcode method
@dipalitusharvlogs7252
@dipalitusharvlogs7252 Жыл бұрын
The Video is very nicely explained.
@sushant5800
@sushant5800 3 жыл бұрын
Just woow!!! Great content..keep it up man
@shareequasiddiqui4948
@shareequasiddiqui4948 2 жыл бұрын
Please make video on spring and microservice interview questions
@prakashp1970
@prakashp1970 Жыл бұрын
In case of hashmap there is no lock of thread, that means any thread can access it.
@Javatechie
@Javatechie Жыл бұрын
Yes but the locking mechanism won't allow multiple threads to play with a single map obj
@parimalamparimalam10
@parimalamparimalam10 11 ай бұрын
automation testing also will ask same way
@kumarrajakotakonda1351
@kumarrajakotakonda1351 2 жыл бұрын
Wrapper classs of set also doesn’t allow duplicates right?
@Javatechie
@Javatechie 2 жыл бұрын
Wrapper class of set ?
@kumarrajakotakonda1351
@kumarrajakotakonda1351 2 жыл бұрын
@@Javatechie u told that while using with custom and wrapper classes need to handle explicitly for duplicate check
@Javatechie
@Javatechie 2 жыл бұрын
@@kumarrajakotakonda1351 if you add Custom class without override equals and hashcode method then set will allow duplicate .
@kumarrajakotakonda1351
@kumarrajakotakonda1351 2 жыл бұрын
@@Javatechie custom class will allow duplicate but wrapper classes doesn’t allow but u said wrapper classes also will allow duplicate in vedio
@Javatechie
@Javatechie 2 жыл бұрын
My mistake
@dipakmohapatra9548
@dipakmohapatra9548 3 жыл бұрын
Thanku so much sir😇
@runthecode_
@runthecode_ 3 жыл бұрын
Excelente
@trendinggadgets07
@trendinggadgets07 3 жыл бұрын
sir please start series on spring microservices😊
@Javatechie
@Javatechie 3 жыл бұрын
Okay I will
@arnabneogi4237
@arnabneogi4237 3 жыл бұрын
please create one for springboot, jpa
@kshitijbansal3672
@kshitijbansal3672 Жыл бұрын
@09:17 can anyone explain what is the meaning of this line if(this.contains(o)), I always get confused, what is "this", what value it holds. I have been working on java since long but still today I got confused with "this". Also, pls suggest where I can learn more about "this".
@pj7876
@pj7876 Жыл бұрын
set.add("P");set.add("p") how i will restrict this?
@muktanandgautam1216
@muktanandgautam1216 2 жыл бұрын
9:38
@RealSlimShady-um6gf
@RealSlimShady-um6gf 11 ай бұрын
Which company are you working Basant?
@krishnakarthik7198
@krishnakarthik7198 2 жыл бұрын
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...!!
@abhijitprusty
@abhijitprusty 3 жыл бұрын
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.
@SairamDasari2000
@SairamDasari2000 2 ай бұрын
Thankyou so much for the video brother learnt a lot , in tree map internal implementation would be binary search tree i think.
@vivekkewalramani2736
@vivekkewalramani2736 3 жыл бұрын
this video covered all the key questions asked in interview. Please create these interview questions video more oftenly.
@enggadda
@enggadda 2 жыл бұрын
hi Sir , can we get the interview questions and answers for Multithreading , i will be verymuch helpful
@Javatechie
@Javatechie 2 жыл бұрын
Okay i will
@AbheyKhurana-tc6be
@AbheyKhurana-tc6be 12 күн бұрын
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
@Javatechie
@Javatechie 12 күн бұрын
Thank you buddy for well wish 🤞
@uvanana.
@uvanana. 5 ай бұрын
Superb ❤
@ILuvBilli
@ILuvBilli 2 жыл бұрын
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);
@santoshkamat6132
@santoshkamat6132 2 жыл бұрын
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😄
@kavithareddy6998
@kavithareddy6998 3 жыл бұрын
Hi basant, could you please create videos on multithreading and executor framework with examples.
@abhishekgowlikar
@abhishekgowlikar 8 ай бұрын
Everyone need this whether fresher or experience, Good Work and Content.
@rexsam3134
@rexsam3134 2 жыл бұрын
Comparable vs Comparator pls don't copy from other websites A and a have different ASCII values and A comes before a. Else use ignoreCase Hashmap with Binary Tree Jeffrey Bosboom has explained to some extent in the year 2015 Below Text is copied and quoted by Subham Mittal If you need to store large amount of data into the HashMap then you should create a HashMap with an initial capacity close to your expected volume. If you missed that , the HashMap will take the default size of 16 and load factor of 0.75. The first 11 put() operations will be fast but the 12th (16*0.75) will resize the bucket with a new capacity of 32. The 13th to 23rd will be fast but 24th (0.75 * 32) will again recreate a costly new representation that doubles the initial size of the bucket. The initial resizing operation will appear at 48th , 96th ,192nd , 384th call of put() operation.
@Javatechie
@Javatechie 2 жыл бұрын
Don't know where you get this example and saying that I copied . Please cross check and share me the link . Yes it could possible that the comparison table image which I explained that I took from Google but not example.
@rexsam3134
@rexsam3134 2 жыл бұрын
@@Javatechie comparision between Comparable vs Comparator is from javatpoint. I am not referring to example
@Javatechie
@Javatechie 2 жыл бұрын
Yes correct that image I used from internet
@kukuusah
@kukuusah 11 ай бұрын
One doubt, they will ask code or only theory in collection in interview?
@Javatechie
@Javatechie 11 ай бұрын
Both
@srinivasdokare4274
@srinivasdokare4274 3 күн бұрын
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?)
@kshitijbansal3672
@kshitijbansal3672 Жыл бұрын
@09:17 can anyone explain what is the meaning of this line if(this.contains(o)), I always get confused, what is "this", what value it holds. I have been working on java since long but still today I got confused with "this". Also, pls suggest where I can learn more about "this".
@Javatechie
@Javatechie Жыл бұрын
You should understand what objects are and how to call them using object r reference or using This
@kshitijbansal3672
@kshitijbansal3672 Жыл бұрын
@@Javatechie this refer to current class object instance, Here in the code, current class object instance is "list" , so we can say, in backend the code should look like....if(list.contains(value)), is that right sir?
@Javatechie
@Javatechie Жыл бұрын
Yes
@AmritAgarwal07
@AmritAgarwal07 Жыл бұрын
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?
@Javatechie
@Javatechie Жыл бұрын
It will go to 0 index
@AmritAgarwal07
@AmritAgarwal07 Жыл бұрын
@@Javatechie ok thanks
@karthibaby7766
@karthibaby7766 3 жыл бұрын
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
@007tushard
@007tushard 3 жыл бұрын
Microsevice also
@Hacks00145
@Hacks00145 3 жыл бұрын
Yes sir.. Would be helpful
@Javatechie
@Javatechie 3 жыл бұрын
Tusar and hacks I will do this .after saga pattern video
@Kunalsumanblogs
@Kunalsumanblogs 2 жыл бұрын
Thanks allot for clear explanation ..I have gone through your and Durgesh sir video's ...And I am very confident about comming interview...
@jagdishkamadi
@jagdishkamadi 2 ай бұрын
@Basant Sir, thank you for providing such an in-depth explanation in simple ways.
@seatconnect224
@seatconnect224 2 жыл бұрын
are you planing to prepare Interview Questions for Spring?
@Javatechie
@Javatechie 2 жыл бұрын
Yes buddy
@bharatiyaashish
@bharatiyaashish 3 жыл бұрын
This was ultimately awesome👏✊👍 Thanks a lot🙏🙇 Waiting 4 nxt vdo...😊🇮🇳🙏🌻👏👏👌👌
@tejastipre9787
@tejastipre9787 28 күн бұрын
Jordar video ❤
@namjitharavind
@namjitharavind 6 ай бұрын
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.
@abhinavpandey3356
@abhinavpandey3356 Ай бұрын
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
@antest6285
@antest6285 3 жыл бұрын
Very nice explanation and thanks for the information about the interview questions. Is it possible to make video on all datastructures
@suryajena1575
@suryajena1575 2 жыл бұрын
Appreciate your efforts , thanks for the good job, invaluable contribution to the community.
@deepakgowda7292
@deepakgowda7292 Жыл бұрын
awesome explanation sir thank you so much sir ❣ sir which company you are working in ?
@ravindranathareddygr8703
@ravindranathareddygr8703 3 жыл бұрын
Thanks for the vedio. Request you to do one AWS EKS microservices deployment .(with 2 services which you created in early vedios)
@NareshKumarD107
@NareshKumarD107 2 жыл бұрын
Thank you so much. Very helpful. Pls make more this type vdos on spring,springboot,jpa,hibernate etc
@debroy1
@debroy1 2 жыл бұрын
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.
@rabindrapatra7151
@rabindrapatra7151 3 жыл бұрын
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.
@routhuaravind6006
@routhuaravind6006 Жыл бұрын
just subscribed !!!😊for sharing the source code and material tnx a lot
@akashtawade9264
@akashtawade9264 2 жыл бұрын
Please upload video on multi-threading tricky questions which asked in interview.
@mubeenkazi
@mubeenkazi 2 жыл бұрын
most beneficial video, all concepts cleared. Will surely recommend
@sibasisdash3984
@sibasisdash3984 2 жыл бұрын
Sir your teaching is vary helpful ,, videos are very important. Please make one single video on spring boot interview questions.
@boopathirajagopalan3047
@boopathirajagopalan3047 9 ай бұрын
Is CopyOnWriteArraySet exists in java ?
@Javatechie
@Javatechie 9 ай бұрын
Yes it's there
@Musical_dropz
@Musical_dropz 6 ай бұрын
It’s used for Set to be Synchronised as it is actually asynchronous
@satyamkumar-qc1mr
@satyamkumar-qc1mr 2 жыл бұрын
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.
@Javatechie
@Javatechie 2 жыл бұрын
Thanks buddy 😀. Glad to know this
@aadiraj6126
@aadiraj6126 3 жыл бұрын
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. 🙏
@vik6330
@vik6330 2 ай бұрын
👌🙏🙏🙏🙏
@Kumar-bg9hp
@Kumar-bg9hp 3 жыл бұрын
bhai how to use intelliJ Idea freely
@Javatechie
@Javatechie 3 жыл бұрын
Download intelij community edition and use it
@dhruvkaushik7062
@dhruvkaushik7062 2 жыл бұрын
great work brother.....make video on multithreading as well....and other spring and spring boot
@MaheshAnand1995
@MaheshAnand1995 2 жыл бұрын
Please make a video on multi threading interview questions.
@arunprasad8261
@arunprasad8261 11 ай бұрын
Thanks Sir.. Very much helpful in preparation.. Concepts are quite clear and proven
@pramodkumbhar1175
@pramodkumbhar1175 3 жыл бұрын
Please make one video on multithreading interview questions in java (Future vs CompletableFuture)
@Javatechie
@Javatechie 3 жыл бұрын
Okay
@nafazbenzema9714
@nafazbenzema9714 3 жыл бұрын
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
@Javatechie
@Javatechie 3 жыл бұрын
My bad , based on his locking mechanism multiple thread can access without concurrent exception
@hanumansays3725
@hanumansays3725 2 жыл бұрын
One of the best interview videos ever seen for Java. Excellent job. Thank you.
@prisinha
@prisinha 2 жыл бұрын
31:31 can't add anything during iteration in list of FailFastList
@KunalKrishna
@KunalKrishna 11 ай бұрын
42:47 note there can only be 1 entry with key=null, however, there may be several entries having value = null
@GOPINATH-xb3im
@GOPINATH-xb3im 2 жыл бұрын
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
@Javatechie
@Javatechie 2 жыл бұрын
Thanks buddy 😌
@Maddy4645
@Maddy4645 3 жыл бұрын
super content and nice explanation, could you please explain how Get method works internally in Hashmap
@karamjitsinghsehdev3451
@karamjitsinghsehdev3451 3 жыл бұрын
Excellent coverage of topics. Please make on spring core (same bean name,type) etc.
@Javatechie
@Javatechie 3 жыл бұрын
Yes I will
@preethisubramani4817
@preethisubramani4817 2 жыл бұрын
Good job !! Ur video helped to understand quickly about collections 👍
@ManishKumar-me2kn
@ManishKumar-me2kn 4 ай бұрын
What is your name sir ? Aap ki voice kishor sir ki tra hai ..
@stephenk297
@stephenk297 2 жыл бұрын
Basant sir,your content very informative Thank you. please make video on spring spring boot and microservice interview questions and answers.
@Javatechie
@Javatechie 2 жыл бұрын
I will
@channabasavav1823
@channabasavav1823 2 жыл бұрын
Thank you so much , it is a much needed videos for all job seekers 🙏🙏🙏🙏
@RussianCyclop
@RussianCyclop 2 жыл бұрын
Great tutorial on Collections Framework interview questions, very informative, thank you!
@yourskishore5790
@yourskishore5790 3 жыл бұрын
Really love you sir...got few offers due to your valuable teaching 😍😍
@Javatechie
@Javatechie 3 жыл бұрын
Thank you kishore
@bhawnarastogi1869
@bhawnarastogi1869 3 жыл бұрын
So far the best and crisp, as it's not just tells theory..it's with example. Great job 👍
@sayanchowdury3245
@sayanchowdury3245 3 жыл бұрын
Sir requesting you to make a video on the programs asked based on arrays,string,lists,sarching and sorting mechanisms
@Javatechie
@Javatechie 3 жыл бұрын
Sayan yes I will
@OracleLand_Official
@OracleLand_Official 3 жыл бұрын
Watch full collections interview questions here part 10 to 15.....
@OracleLand_Official
@OracleLand_Official 3 жыл бұрын
Thanks @Sayan
@dedeepyaamasa4441
@dedeepyaamasa4441 2 жыл бұрын
very clearly explained,waiting for more in this series
@biswajeetsahoochintu2329
@biswajeetsahoochintu2329 3 жыл бұрын
wow sir sir please go through all interview question of java sir we are waiting for your video sir
@prisinha
@prisinha 2 жыл бұрын
43:43 HashTable vs ConcurrentHashMap
@dhanyav5675
@dhanyav5675 2 жыл бұрын
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
@Javatechie
@Javatechie 2 жыл бұрын
Cool buddy. Good to hear this
@amanabhishek8998
@amanabhishek8998 11 ай бұрын
U rocks again. Please make one video of Multithreading interview qustions for more than 5years experienced , in youtube hardly to find any tututorials
@Javatechie
@Javatechie 11 ай бұрын
Thanks buddy these questions also asked in 8+ experience person
@amanabhishek8998
@amanabhishek8998 11 ай бұрын
​@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😊
@Javatechie
@Javatechie 11 ай бұрын
Thank you so much Aman for following Javatechie and appreciate your word 🤗
@RameshBogandla
@RameshBogandla 9 ай бұрын
I need talk with you how l can reach you?
@amolgangadharpaydalwar4279
@amolgangadharpaydalwar4279 3 жыл бұрын
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
@Javatechie
@Javatechie 3 жыл бұрын
Yes I will
@Kishore_327
@Kishore_327 Жыл бұрын
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.
@Javatechie
@Javatechie Жыл бұрын
Keep learning buddy ☺️
@babuforuful
@babuforuful 3 жыл бұрын
Dear JavaTechie Very good awesome videos
@sivamuluguri8142
@sivamuluguri8142 2 жыл бұрын
Amazing explanation thank you.
@manojpatil2457
@manojpatil2457 2 жыл бұрын
You are indeed Java Techie sir, Crisp explaination.. 🙌
@aditipai7289
@aditipai7289 3 жыл бұрын
Well explained. I especially liked the Hashmap explanation with diagram
@prisinha
@prisinha 2 жыл бұрын
15:15 usage of equals and hash code method
@uma4525
@uma4525 3 жыл бұрын
Good content. please upload Multithreading interview questions as well.Thank You!
@Javatechie
@Javatechie 3 жыл бұрын
I will
@ShreyasDangetechie
@ShreyasDangetechie 3 жыл бұрын
very good set of questions covered .. Thanks for the video ..!!
@damubsr
@damubsr 2 жыл бұрын
Good job,the way of approach is good i.e theory and then code.keep it up
@Javatechie
@Javatechie 2 жыл бұрын
Thanks buddy 😊
@pratishrutipanda6461
@pratishrutipanda6461 3 жыл бұрын
You explained excellently
@OracleLand_Official
@OracleLand_Official 3 жыл бұрын
Watch full collections interview questions here part 10 to 15.....
@prisinha
@prisinha 2 жыл бұрын
38:38 Usage of ConcurrentHashMap in CustomThread makes ConcurrentHashMap Fail-safe from Concurrent Modification Exception
@kunalsharma-zc2ho
@kunalsharma-zc2ho 3 жыл бұрын
Basant sir please interview question series for spring , hibernate and spring boot.
@Javatechie
@Javatechie 3 жыл бұрын
Kunal I will do
@sreenivasareddydwarampudi6034
@sreenivasareddydwarampudi6034 3 жыл бұрын
Thank you very much sir🙏🙏🙏
@shemantsingh765
@shemantsingh765 2 жыл бұрын
very well explained Techie✌✌✌
@prisinha
@prisinha 2 жыл бұрын
44:44 Collections.synchronizedMap(map) and synchronized HashTable both does not have segment level locking mechanism.
@jayanthreddy2292
@jayanthreddy2292 3 жыл бұрын
In first question "Map is not a part of collection" I think
@Javatechie
@Javatechie 3 жыл бұрын
As per book hierarchy it's correct but not in real
@prakashp1970
@prakashp1970 Жыл бұрын
Superb bro, thanks
An Unknown Ending💪
00:49
ISSEI / いっせい
Рет қаралды 56 МЛН
The joker favorite#joker  #shorts
00:15
Untitled Joker
Рет қаралды 30 МЛН
GIANT Gummy Worm Pt.6 #shorts
00:46
Mr DegrEE
Рет қаралды 96 МЛН
Миллионер | 1 - серия
34:31
Million Show
Рет қаралды 2 МЛН
Infosys | Java | Spring Boot | Microservices | Mock Interview
26:55
Java HR Mock Interview On Core Java | Java Interview Question | Collection, String | By Kiran Sir
21:26
Top 25 Microservice Interview Questions Answered - Java Brains
39:54
An Unknown Ending💪
00:49
ISSEI / いっせい
Рет қаралды 56 МЛН