Java 8 Streams programs you must prepare for Java Interviews

  Рет қаралды 85,109

Siva Reddy

Siva Reddy

3 жыл бұрын

Below are the frequently asked programs during the coding round in java interviews. In this video, I explain the below programs in detail.
Please make sure, you prepare well for the below programs.
1.Write a program to print employee details working in each department
2.Write a program to print employees count working in each department
3.Write a program to print active and inactive employees in the given collection
4.Write a program to print Max/Min employee salary from the given collection
5.Write a program to print the max salary of an employee from each department

Пікірлер: 77
@SandeepKumar-se2fd
@SandeepKumar-se2fd 2 жыл бұрын
Great and wonderful example for Stream API.... Great!!!!!
@SivaReddyJavaTechie
@SivaReddyJavaTechie Жыл бұрын
Glad you liked it!
@venkatesha6378
@venkatesha6378 9 ай бұрын
super siva , good keep it up. its 13 years since we met.
@InterviewDOT
@InterviewDOT 3 жыл бұрын
Very nice thanks for sharing 👌🙏
@venkatsam2472
@venkatsam2472 3 жыл бұрын
Wonderful explanation with example. Thank you so much. Will be waiting to see more videos.. 👏🏻👌🏻🙏🏻👍
@javatech8530
@javatech8530 2 жыл бұрын
HCL Technologies Technical Round | 5+ Years Virtual Interview | Java Developers kzbin.info/www/bejne/jZ7bnYGmest_ZpY
@lakshmidevilakshmidevi3984
@lakshmidevilakshmidevi3984 9 ай бұрын
Thank you for sharing your knowledge with us Sir
@JameS00989
@JameS00989 2 жыл бұрын
Amazing video Shiva much appreciated
@SivaReddyJavaTechie
@SivaReddyJavaTechie Жыл бұрын
Glad you liked it
@SuccessToSamadhi
@SuccessToSamadhi Жыл бұрын
excellent sir.. Thank you
@chetandy2573
@chetandy2573 3 жыл бұрын
Thanks sir, very nicely explained
@javatech8530
@javatech8530 2 жыл бұрын
HCL Technologies Technical Round | 5+ Years Virtual Interview | Java Developers kzbin.info/www/bejne/jZ7bnYGmest_ZpY
@javatech8530
@javatech8530 2 жыл бұрын
HCL Technologies Technical Round | 5+ Years Virtual Interview | Java Developers kzbin.info/www/bejne/jZ7bnYGmest_ZpY
@zuberdiwan8123
@zuberdiwan8123 Жыл бұрын
Very Nice Video. very well Explained. Thank You.......
@SivaReddyJavaTechie
@SivaReddyJavaTechie Жыл бұрын
You are most welcome
@Vithal_Nivargi
@Vithal_Nivargi Жыл бұрын
Thank you please make one more video on Java8 coding questions
@maheshuma741
@maheshuma741 2 жыл бұрын
Thank you sir for making this video. . To get active and Inactive works in a single Iteration we can use partitionBy() method. Sample Code : employeeList.stream().collect( Collectors.partitioningBy(emp->"active".equalsIgnoreCase(emp.getName())) , It returns Map . At the calling place map.get(true) for active and map.get(false) for inactive.. We have n number of ways it is the one of the way.
@kshitijbansal3672
@kshitijbansal3672 Жыл бұрын
Can we do like this also? List.stream(). collect (Collectors.groupingBy(Employee: getStatus(), Collectors.counting()); It will first group by on basis of Active and Inactive and then count it.
@deepa8177
@deepa8177 6 ай бұрын
great video specially quetsion no 5.
@DMvali
@DMvali 2 жыл бұрын
Thanks siva!
@riteshchiddarwar9881
@riteshchiddarwar9881 3 жыл бұрын
@siva, its very useful for quick review of java 8 streams. Very nice example you taken and explained . 👍 very best and helpful.
@javatech8530
@javatech8530 2 жыл бұрын
HCL Technologies Technical Round | 5+ Years Virtual Interview | Java Developers kzbin.info/www/bejne/jZ7bnYGmest_ZpY
@mamatharao2127
@mamatharao2127 2 жыл бұрын
Excellent
@anandpadamala3586
@anandpadamala3586 3 жыл бұрын
Nice sir 👌
@maheshd3506
@maheshd3506 2 жыл бұрын
clear explanation and thanks
@SivaReddyJavaTechie
@SivaReddyJavaTechie Жыл бұрын
Glad you liked it
@thebaseofpcmbclasses8028
@thebaseofpcmbclasses8028 Жыл бұрын
nice explanation sir
@maheshuma741
@maheshuma741 2 жыл бұрын
To calculate dept wise statistics like min,max,average we can use following code : empList.stream.collect(Collectors.groupingBy(Employee::getDeptId, Collectors. summarizingDouble(Employee::getSal))) ; it returns Map . Just for knowledge purpose sharing my thoughts.. Don't take it in another way.
@deepa8177
@deepa8177 6 ай бұрын
thanks fro sharing..
@adityapratapsingh7311
@adityapratapsingh7311 3 жыл бұрын
Very helpful videos,make more such java8 programming videos....thanks a lot sir
@javatech8530
@javatech8530 2 жыл бұрын
HCL Technologies Technical Round | 5+ Years Virtual Interview | Java Developers kzbin.info/www/bejne/jZ7bnYGmest_ZpY
@poojas1600
@poojas1600 Жыл бұрын
Excellent video
@SivaReddyJavaTechie
@SivaReddyJavaTechie Жыл бұрын
Thank you very much!
@srinivass5552
@srinivass5552 3 жыл бұрын
Thanks sir very useful
@javatech8530
@javatech8530 2 жыл бұрын
HCL Technologies Technical Round | 5+ Years Virtual Interview | Java Developers kzbin.info/www/bejne/jZ7bnYGmest_ZpY
@muchukundareddy5315
@muchukundareddy5315 Жыл бұрын
Hi Siva, I tried Lambda expression as input for "Comparator.comparing" It was not working
@bacchaparty6275
@bacchaparty6275 3 жыл бұрын
U r brilliant sir
@SivaReddyJavaTechie
@SivaReddyJavaTechie 3 жыл бұрын
Thanks Amit. Please share our KZbin channel to your friends circle as it may be helpful for them. Happy Learning.
@bacchaparty6275
@bacchaparty6275 3 жыл бұрын
@@SivaReddyJavaTechie Sure Sir
@javatech8530
@javatech8530 2 жыл бұрын
HCL Technologies Technical Round | 5+ Years Virtual Interview | Java Developers kzbin.info/www/bejne/jZ7bnYGmest_ZpY
@kemparaj565
@kemparaj565 2 жыл бұрын
Amazing explanation. Thank You 😊. Could have formatted the code. Few parts of code is missing.
@abhishekjain6559
@abhishekjain6559 2 жыл бұрын
Nice video.. very nicely explain.. Can you please explain the reducing function example.
@local-host80-80
@local-host80-80 3 жыл бұрын
thanks
@SivaReddyJavaTechie
@SivaReddyJavaTechie 3 жыл бұрын
Thanks Nagesh. Please refer our KZbin Channel to your friends and colleagues as it may helpful for them. Happy learning.
@start1learn-n171
@start1learn-n171 4 ай бұрын
Tq
@rajuls6101
@rajuls6101 2 жыл бұрын
Sir can you answer this select employee where department is technology and location not equal to mumbai..
@ShinAkuma
@ShinAkuma 2 жыл бұрын
filter( e -> "technology".equals(e.getTechnology()) && !( "mumbai".equals(e.getCity()) ) )
@Proman.Offbeat.Traveller
@Proman.Offbeat.Traveller Жыл бұрын
NYC information 22:33
@indranildas8485
@indranildas8485 Жыл бұрын
what is the name of the background music?
@dharamkirti24
@dharamkirti24 2 жыл бұрын
Sir a git hub link would have been helpful
@vikrantharne5269
@vikrantharne5269 3 жыл бұрын
Sir outer joins practice questions plz..scenario based
@SivaReddyJavaTechie
@SivaReddyJavaTechie 3 жыл бұрын
Sure. I will upload soon.
@vikrantharne5269
@vikrantharne5269 3 жыл бұрын
@@SivaReddyJavaTechie waiting..I'm still confused abt tht topic...
@SivaReddyJavaTechie
@SivaReddyJavaTechie 3 жыл бұрын
Sure. I will upload video on the requested topic as soon as possible
@javatech8530
@javatech8530 2 жыл бұрын
HCL Technologies Technical Round | 5+ Years Virtual Interview | Java Developers kzbin.info/www/bejne/jZ7bnYGmest_ZpY
@pratapjavasingh3239
@pratapjavasingh3239 3 жыл бұрын
I can request u sir whenever u writing the codes then atleast first explain predefined method apart from that then u can write the code it's request 🙏
@SivaReddyJavaTechie
@SivaReddyJavaTechie 3 жыл бұрын
Hi Pratap, Good suggestion. I make a note of it and will do same for future videos.
@pratapjavasingh3239
@pratapjavasingh3239 3 жыл бұрын
@@SivaReddyJavaTechie Thank you 🙏
@javatech8530
@javatech8530 2 жыл бұрын
HCL Technologies Technical Round | 5+ Years Virtual Interview | Java Developers kzbin.info/www/bejne/jZ7bnYGmest_ZpY
@morning8474
@morning8474 3 жыл бұрын
sir plz upload hai video where u would teach run time question only.............Request by your suscriber
@SivaReddyJavaTechie
@SivaReddyJavaTechie 3 жыл бұрын
The intention is to emphasis on the importance of these programs so that viewers can pay more attention to prepare for the same and will get benefit in the interview.
@javatech8530
@javatech8530 2 жыл бұрын
HCL Technologies Technical Round | 5+ Years Virtual Interview | Java Developers kzbin.info/www/bejne/jZ7bnYGmest_ZpY
@knowledgeshare1622
@knowledgeshare1622 Жыл бұрын
how to find sum of the salary of each department????
@jeckrazi7691
@jeckrazi7691 Жыл бұрын
Map mapEmpDept = empList.stream().collect(Collectors.groupingBy(Employee::getDept, Collectors.summarizingInt(Employee::getSalary))); mapEmpDept.entrySet().forEach(entry -> System.out.println("Dept:: " + entry.getKey() + " & Sum:: " + entry.getValue().getMin()));
@enlightened7354
@enlightened7354 Жыл бұрын
Filter?
@CodeUpskill
@CodeUpskill 2 жыл бұрын
hi siva, can u give code github url?
@javatech8530
@javatech8530 2 жыл бұрын
HCL Technologies Technical Round | 5+ Years Virtual Interview | Java Developers kzbin.info/www/bejne/jZ7bnYGmest_ZpY
@gottepavani1838
@gottepavani1838 Жыл бұрын
Sir how to get second max salary
@jeckrazi7691
@jeckrazi7691 Жыл бұрын
//Second Minimum Salary empList.stream().sorted(Comparator.comparing(Employee::getEmpSalary)).skip(1).limit(1).forEach(System.out::println); //Second Maximum Salary myEmployee_Demo.stream().sorted((e1,e2)-> (e1.getEmpSalary() < e2.getEmpSalary()) ? 1 : ((e1.getEmpSalary() == e2.getEmpSalary()) ? 0 : -1)).skip(1).limit(1).forEach(System.out::println);
@chinnimounika8645
@chinnimounika8645 2 жыл бұрын
Sir can you help me to slove my assignment programs in Java
@errahulrajocjp
@errahulrajocjp 2 жыл бұрын
Hello Sir ! Thank you for explanation. Q 5) Dept 103 having two employee having same salary 3500, but showing only one employee as a result ?
@javatech8530
@javatech8530 2 жыл бұрын
HCL Technologies Technical Round | 5+ Years Virtual Interview | Java Developers kzbin.info/www/bejne/jZ7bnYGmest_ZpY
@palanirajkumar4904
@palanirajkumar4904 3 жыл бұрын
sir send the code
@javatech8530
@javatech8530 2 жыл бұрын
HCL Technologies Technical Round | 5+ Years Virtual Interview | Java Developers kzbin.info/www/bejne/jZ7bnYGmest_ZpY
@coincidentIndia
@coincidentIndia 2 жыл бұрын
why using reducing ? we can directly use the maxBy on groupBy DepartmentId. Map maxSalaryByDept = employeeList.stream().collect(Collectors.groupingBy(Employee::getEmployeeDepartmentId, Collectors.maxBy(Comparator.comparing(Employee::getSalary)))); maxSalaryByDept.forEach((k,v)->{System.out.println("Dept "+k+" Salary "+v);});
Java Is Better Than Rust
42:14
ThePrimeTime
Рет қаралды 146 М.
New model rc bird unboxing and testing
00:10
Ruhul Shorts
Рет қаралды 25 МЛН
КАК ДУМАЕТЕ КТО ВЫЙГРАЕТ😂
00:29
МЯТНАЯ ФАНТА
Рет қаралды 9 МЛН
Cracking the coding interview || Java streams Coding questions
20:31
Java 8 Interview questions/Interview Preparation
24:08
Byte Programming
Рет қаралды 130 М.
Java 8 Streams | map () & flatMap() Example | JavaTechie
15:37
Java Techie
Рет қаралды 210 М.
Java 8 STREAMS Tutorial
18:10
Oggi AI - Artificial Intelligence Today
Рет қаралды 733 М.