Cracking the coding interview || Java streams Coding questions
ฝัง
- เผยแพร่เมื่อ 5 ก.ย. 2024
- cracking the coding interview made easy with the help of coding interview questions. This video contains must do coding questions, programming interview questions also subscribe us for daily coding problem.
for source code visit: javatechiess.w...
-----------------------------------------
Subscribe to our channel : / javatechies
Connect to us on WhatsApp: chat.whatsapp....
Connect to us over Email : JavaTechiess@gmail.com
Different companies interviews: • Java real time intervi...
Top 10 Core java interview questions : • Top 10 Core java inter...
Top 10 Collections interview questions : • Top 10 Java collection...
Java Scheduler and Timer task : • Spring boot Scheduler ...
Java program to find duplicate elements: • JAVA Program to find d...
Java Program to find frequency of elements: • Java program to find F...
Philips Java telephonic interview: • Philips Java Telephoni...
Accenture java interview: • Philips Java Telephoni...
HCL java interview : • Selected | java teleph...
DELL java interview : • JAVA telephonic interv...
Telstra Java interview: • Telstra real interview...
UST global java interview : • UST Global real Interv...
Ciena java interview : • UST Global real Interv...
Altran java interview: • UST Global real Interv...
L n T java Interview: • L&T java Interview rea...
Wissen Technology java interview: • L&T java Interview rea...
TCS Java Interview: • L&T java Interview rea...
JP Morgan java interview: • JPMorgan Java Microser...
VMWare java interview: • JPMorgan Java Microser...
PayPal java interview: • Video
Bottomline java interview: • Video
Standard chartered Bank java interview: • Video
Siemens java interview: • Video
Mphasis java interview: • Video
Altimetrik java interview: • Video
M3BI java interview: • Video
ITC Infotech java interview: • Video
Oracle java interview: • Video
VMWare java interview: • Video
Unisys Java Interview: • Unisys Round 1 Java de...
Top 10 Tricky core java Interview questions top java interview questions, top java interview questions and answers, top interview questions and answers, top java interview questions for freshers, top 10 java interview questions, tricky java interview questions, tricky java interview questions for experienced, tricky java questions, java tricky interview questions, top 50 java interview questions, top 50 core java interview questions, java interview questions by durga sir, java interview questions for experienced, java interview questions for freshers, java interview questions and answers, java interview questions and answers edureka
#java #javaInterviewQuestions #JavaInterviewQuestionsandAnswers #Intellipaat #JavaInterview #CoreJavaInterviewQuestions #JavaInterviewQuestionsandAnswersForExperienced #JavaTutorial #JavaProgramming #JavaTutorialForBeginners
Thanks
Java Techies
This is very informative and useful. Thanks for the excellent streams questions and solutions.
Thank you so much for your feedback and support, it motivates me.
one more question to add to list...
que : get all employee having address (is of list type) start with P and having age greater than 22
ans : employees.stream()
.filter(employee -> employee.getAge()>22&&employee.getAddresses().stream()
.anyMatch(adr -> adr.getCity().startsWith("p")))
.forEach(System.out::println);
Very nice exercise for practice on Streams. Excellent.
On the spot. Best practical video on this topic so far. Will revisit again and again to refresh my memory.
Thanks for your support
Love you Manasi. You really helping others.
Thanks
i love you too mansi
@@anuragpundir1483 ?????
Keep up the good work Mansi and Team , you guys are really helpful in cracking the interviews.
Thank you sir ji
Excellent. We'll organised.
THANKS FOR YOUR VALUABLE INFORMATION ,IT HELP TO GET KNOWLEDGE
Most welcome, we keep on sharing more valuable information in our whatsapp and telegram groups too.
Feel free to join there of you want.
Very very Helpful 👍 Thank you so much.
Keep posting such real time scenarios of coding.
It s really helpful. Thanks Java Techies Team.
Thanks a lot for your effort and time you have invested to make us understand so clear in simple but effective examples. 🙏
Thanks
Really helpful questions to brush up
Thank you so much
Thank you so much.. these examples are enough to crack the java8 for interview questions
Thank you
Hi i really happy for this example.please prepare more programming interview questions
Thank you so much, sure
Excellent Questions
Thank you
This is a fantastic list of questions.
You nailed it mansi . very impressive set of questions . keep up the good work
Thank you so much, I really appreciate your feedback 🙏
Thank you so much. This video gave more clarity on Streams. Can you please make a video on the Design patterns where it is implemented interview point of view .
Sure
Good tutorial for java streams and lambda.
Though I noticed that you used == for string comparison while we should use .equals something like "Male".equals(x.getGender())
Thank you
Thanks, Looking for such compilation of questions to practise stream. Really helpful 😄
Thanks
Thanks a ton for your hardwork and service...you are really helping a lot in cracking interviews..
Thanks
Thankyou so much for the informative questions
You're welcome 🙏
for the question no 12 - I did some changes, here we need the list of names for each department which can be done with only stream like below.
Map namesByDept = employeeList.stream().collect(
Collectors.groupingBy(Employee::getDepartment)
)
.entrySet().stream()
.collect(Collectors.toMap(o -> o.getKey(), o -> o.getValue()
.stream()
.map(m -> m.getName())
.collect(Collectors.toList())
));
Thanks
bahaut badhiya didi
Thank you
Thanks Mansi for sharing your knowledge & Experience ❤️.
Welcome 🙏
Excellent
Thanks
You people are doing great work 👍👍
Best stream api videoon TH-cam
Thank you so much
Superb
I appreciate your hard work
Thanks
Absolutely loved the content, helped me a lot! Thanks 👍🏼
Thanks
Great work Manasi 👍thanks for the video ✌️
Thanks
Examples you have taken here are really helpful, Good Work keep it up.
I want you to Correct 1-2 mistakez here while comparing string you have using == operation instead of that we should use equals method.
Ya, fine, thank you
Thanks a ton Mansi..Really appreciate you 👏🏻👏🏻
Thank you
Thanks a lot Java Techies..
You are welcome
This what exactly iam looking for.
Thanks
Thanks Mansi for your extreme efforts, keep it up. we need more videos from you. For the method 8 we can use like these right? Optional min = employeeList.stream().min(Comparator.comparing(Employee :: getYear));
Hi Ma'am, First of all Thank you very much for your efforts, its really helpful. wanted to ask one question: in method8 i am getting Optional.empty whereas if i remove either of condition then then o get some result, why so for me?
I did not get your question, join us on WhatsApp or telegram group, which is totally free, you can share your code and questions, either me or someone will be able to help you. thank you
Vry useful examples
Request u to increase the font size of programs
Extremely sorry if that's not correctly visible, will take care next time
@@JavaTechies tq
TQ...that's helpful
Great work . Thanks a lot.
Thanks
Tq
You are welcome
Keep up the good work 👏
Thanks
Awesome content 👍
Thank you DellCruzo
just awesome 👍
Thank you
Good one mansi and the backend team :)
Be the team
But how static method reference to Employee getter methods are working even if they are non-static method?
This is awesome dude, why you stopped making, please make some more
Thank you buddy, for sure we will add more. Working on something more awesome 😊
If source code link was added in the description it would be better
Added
Also for method4, what if we have 2 employees with same highest salary? then it displays only 1 person's salary....why so why not 2 if both have same highest salary?
Is it using findfirst ??
Thanks you so much
Wc
👏👏👏👏👍👍👍👍👍
Tqs a lot !!
Welcome 🙏
Hi
I have one question where i need to sort based on price. Can you please help
Ques: Using Java8, sort the products in "Electronics" and "Accessories" by attribute "price" in desc order?
public static void sortData() {
List electronics = new ArrayList();
Map map1 = new HashMap();
map1.put("price", "100");
map1.put("name", "Camera");
Map map2 = new HashMap();
map2.put("price", "200");
map2.put("name", "Laptop");
Map map3 = new HashMap();
map3.put("price", "90");
map3.put("name", "WebCam");
electronics.add(map1);
electronics.add(map2);
electronics.add(map3);
// Comparator.comparing() ->Integer.parseInt();
List accessories = new ArrayList();
Map amap1 = new HashMap();
amap1.put("price", "50");
amap1.put("name", "CameraBag");
Map amap2 = new HashMap();
amap2.put("price", "80");
amap2.put("name", "LaptopBag");
Map amap3 = new HashMap();
amap3.put("price", "10");
amap3.put("name", "MousePad");
accessories.add(amap1);
accessories.add(amap2);
accessories.add(amap3);
Map input = new HashMap();
input.put("Electronics", electronics);
input.put("Accessories", accessories);
}
method4. high salary name is giving only last list name always.. please correct it.
could get the result by this way also employeeList.stream().max(Comparator.comparing(Employee::getSalary);
Hi, most of your videos in the description are private. Unable watch. Can you help please?
You can directly go to my channel and watch, all the visible ones will be public
Hi , Need one help can u plz help how to get 2nd highest salary of each department
Where is sir?🌹
cant get the source code, page not opening
Login and try, it should open
@@JavaTechies got it🥳
Can I get te code for pratice
Yes, go to our GitHub
Pls provide the source code
Can you please share github link?
Posted on our website: javatechiess.wordpress.com/2021/06/02/cracking-the-coding-interview-java-streams-coding-questions/
@@JavaTechies couldn't find the githib link in the site. Can you please add it under the video description section. Thanks in advance. Nice content extremely helpful. Awaiting for more concepts and videos.
If there is more than 1 highest paid employee then it will give wrong result I think? For that :
empList.stream()
.collect(Collectors.groupingBy(Employee::getSalary, TreeMap::new, Collectors.toList()))
.lastEntry() // for lowest salary you should use firstEntry;
.getValue().forEach(entry -> System.out.println("Name : "+entry.getName() + " , "+ "Salary : "+ entry.getSalary()));
Thanks