Java 8 Q&A |  Asked in Myntra | Find Nth Highest Salary Using Java Streams API | JavaTechie

Java 8 Q&A | Asked in Myntra | Find Nth Highest Salary Using Java Streams API | JavaTechie

Java Techie

1 год назад

45,103 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@Suryanarayan094
@Suryanarayan094 - 20.11.2023 23:26

We want more this kind of videos.

Ответить
@prabhakarkevat6846
@prabhakarkevat6846 - 08.11.2023 04:19

Thanks for the awesome tutorial! I was asked the following question in MPhasis interview. Please help with the solution:
Write a program to get the biggest continuous subarray.
e.g. we have an array [1,3,4,5,6,9,10,12], we need to get 3,4,5,6.

Ответить
@bhargavi4557
@bhargavi4557 - 23.10.2023 14:38

I was asked in a interview How to remove adjacent duplicates of a string in java8

Ответить
@sreetmi1918
@sreetmi1918 - 21.10.2023 23:39

this is really good video for those who are lagging in doing programming with corejava.... if any one practice this and learn doing on their own..they ll start become stronger and stronger intheir coding skillls... thanks for the good work..

Ответить
@krishnan6201
@krishnan6201 - 16.10.2023 22:45

can you please make video on functional interface with recursive?

Ответить
@RiskyRishy
@RiskyRishy - 21.09.2023 14:21

great

Ответить
@mehedihassan5184
@mehedihassan5184 - 15.09.2023 22:42

Thanks

Ответить
@abasahebbhingardeve5464
@abasahebbhingardeve5464 - 10.09.2023 09:57

Kindly make a video on fetching Arrey Index of top 4 records from millions of record in a database.

Ответить
@beetc305shivsundarbankar9
@beetc305shivsundarbankar9 - 30.08.2023 21:58

In output we got the map<S,N> has key salary and value name, but if I want same map<N,S> in which key is name and salary is value is it possible?

Ответить
@yashwanthbedre8220
@yashwanthbedre8220 - 05.08.2023 20:18

First group it to avoid complexity
// Group employees by salary
Map<Double, List<Employee>> employeesBySalary = employees.stream()
.collect(Collectors.groupingBy(Employee::getSalary));

// Sort salaries in descending order
List<Double> sortedSalaries = employeesBySalary.keySet().stream()
.sorted(Comparator.reverseOrder())
.collect(Collectors.toList());

// Find and display employees for each group
for (Double salary : sortedSalaries) {
System.out.println("Salary: " + salary);
List<Employee> employeesWithSameSalary = employeesBySalary.get(salary);
employeesWithSameSalary.forEach(emp -> System.out.println(" - " + emp.getName()));

Ответить
@66thakur99
@66thakur99 - 08.07.2023 10:58

private static Entry<Double, List<String>> getnthHighestSalaryEmployeeName(Map<Double, List<String>> mappedWithSalary, Integer n) {
return mappedWithSalary.entrySet().stream()
.sorted(Collections.reverseOrder(Map.Entry.comparingByKey()))
.skip(n - 1)
.findFirst()
.orElse(null);
}

Ответить
@pedurujagadish5048
@pedurujagadish5048 - 06.07.2023 17:08

And also debugging process in realtime project chey bro series

Ответить
@pedurujagadish5048
@pedurujagadish5048 - 06.07.2023 17:07

Bro realtime project implement action series chey bro

Ответить
@rabisankarpodder7839
@rabisankarpodder7839 - 05.07.2023 15:01

I have made it by the following way Employee nthHighestEmployee = employees.stream()
.sorted(Comparator.comparingDouble(Employee::getSalary).reversed()).skip(n - 1).findFirst()
.orElse(null);

Ответить
@sagarjaiswal9451
@sagarjaiswal9451 - 05.07.2023 10:00

Optional<List<Employee>> secondHighestEmployee = employees.stream()
.collect(Collectors.groupingBy(Employee::getSalary, TreeMap::new, toList()))
.entrySet()
.stream()
.skip(n-1)//
.map(Map.Entry::getValue)
.findFirst();

System.out.println(secondHighestEmployee);

Ответить
@alicimen8782
@alicimen8782 - 04.07.2023 01:23

Thanks for good content. Hope you keep sharing on((:

Ответить
@shivAgar2020
@shivAgar2020 - 03.07.2023 09:21

Experience ??

Ответить
@sudharsansathiamoorthy1075
@sudharsansathiamoorthy1075 - 02.07.2023 14:05

Excellent tutorial Bro!! Please keep post solving new problems!!

Ответить
@suryaambati4880
@suryaambati4880 - 30.06.2023 09:25

Hi ,I have list of employee objects I just want sort my employee list based on name in ascending order age in descending order ,salary in ascending order at a time
How we make this combine sort ?

Ответить
@kshitijbansal3672
@kshitijbansal3672 - 24.06.2023 17:09

Sir, I cant thank you more, today I had 2nd technical round with TechM, the interviewer asked the same question, that how you will group male and female on the basis of dept. but you are getting the Dept. name as a method argument. I randomly watched this video 3-4 days back and today when interviewer asked this question, I could only think about this video and provided him the solution in a minute.

Ответить
@kshitijbansal3672
@kshitijbansal3672 - 24.06.2023 17:09

Sir, I cant thank you more, today I had 2nd technical round with TechM, the interviewer asked the same question, that how you will group male and female on the basis of dept. but you are getting the Dept. name as a method argument. I randomly watched this video 3-4 days back and today when interviewer asked this question, I could only think about this video and provided him the solution in a minute.

Ответить
@siddharthagrawal4280
@siddharthagrawal4280 - 19.06.2023 22:47

I have upcoming interview 2nd round on Friday. I know backend spring boot but am not aware of java 8 and all crucial features and usecases of it, i am told it will be asked for sure.
Can you please suggest me few sources to understand everything about java 8 from scratch?? Or best make a small playlist if possible.
Humble request! Could be Life changing for me!

Ответить
@sarojsahoo8763
@sarojsahoo8763 - 19.06.2023 19:53

Map<String,Integer> dataMap = new HashMap<>();
dataMap.put("Bharat",10000);
dataMap.put("Ram",1200);
dataMap.put("Laxman",1600);
dataMap.put("Ravan",4500);
dataMap.put("Lav",5230);

Map.Entry<String, Integer> nthHighest = dataMap.entrySet().stream()
.sorted(Map.Entry.comparingByValue(Comparator.reverseOrder()))
.skip(2)
.findFirst()
.get();

System.out.println(nthHighest); //Can be done this way also

Ответить
@muthulakshmisk5650
@muthulakshmisk5650 - 19.06.2023 19:29

Hi bro.. ur videos are more clear. Are you working in software company?

Ответить
@Thd369
@Thd369 - 19.06.2023 18:08

Thank you

Ответить
@sumitsehgal8034
@sumitsehgal8034 - 18.06.2023 20:01

Good one brother

Ответить
@Aman-Thakor
@Aman-Thakor - 18.06.2023 16:21

If I'm passing num value gt than size of sorted list, it will fail at get(index). What we can do in that case on streams?

Ответить
@Anilkumar-reddy
@Anilkumar-reddy - 18.06.2023 15:24

Good video bro. Please make a more videos on java8 interview questions

Ответить
@DurgaShiva7574
@DurgaShiva7574 - 18.06.2023 15:13

superb content

Ответить
@santruptaprasaddash2634
@santruptaprasaddash2634 - 18.06.2023 10:20

Sir I LRU and LFU cache using LinkedHashMap please. I failed epam interview because of LFU cache.

Ответить
@abhishekgowlikar
@abhishekgowlikar - 18.06.2023 06:47

Amazing videos for java techies.

Ответить
@vino7tech
@vino7tech - 18.06.2023 06:44

Thank Your very Much sir. Many programmers are learn more knowledge by yours videos.

Ответить
@sajid.farooqi8074
@sajid.farooqi8074 - 18.06.2023 04:42

Nice way of delivering such complicated looking problem.

Ответить
@ManojKumar-te5by
@ManojKumar-te5by - 18.06.2023 00:39

Can you make an real example of Optional where use some frequent and important methods like OrElseGet() etc

Ответить
@naincysharma5522
@naincysharma5522 - 17.06.2023 22:39

Even if you cant...no worries..thanks for your efforts in making these videos that are of so much help

Ответить
@naincysharma5522
@naincysharma5522 - 17.06.2023 22:38

Can you please help on a interview question where they asked to create a person class that has some fields like id, name, address, age etc and there can be 100+ such field in person class.

We need to write a program to sort the person data using some dynamic criteria, like sample criteria can be

Id only
Id+ name
Name onky
Age onky
Id+name+age

And so on



Can you help me on this..

She suggested to use reflection api getdeclaredfield method and getproperty to solve yhis...which i cud not relate to

Ответить
@gopisambasivarao5282
@gopisambasivarao5282 - 17.06.2023 21:48

Thanks Basanth.Nice Video. God bless you.

Ответить
@rnages1921
@rnages1921 - 17.06.2023 20:38

Big thanks from Africa

Ответить
@yatendra__singh
@yatendra__singh - 17.06.2023 19:45

After watching these kind of videos from you ...i am just thinking how some one like you❤ got this much of depth knowledge in java ... could you please explain me in one word??

Ответить
@immortalhuman7085
@immortalhuman7085 - 17.06.2023 19:42

Can you make video on how to switch from service based company to product based company?

Ответить
@purnasahu8766
@purnasahu8766 - 17.06.2023 18:03

Excellent, plz bring such new types of java coding questions in your upcoming videos...

Ответить
@charliegamboa9567
@charliegamboa9567 - 17.06.2023 17:36

What a useful content and example. Thanks for sharing

Ответить
@srinath710
@srinath710 - 17.06.2023 17:32

Good one ❤

Ответить
@rishiraj2548
@rishiraj2548 - 17.06.2023 17:12

🙏👍

Ответить
@tanson86
@tanson86 - 17.06.2023 17:01

Nice incremental way of teaching streams in general.

Ответить
@souvikc37
@souvikc37 - 17.06.2023 16:52

Awesome 👍

Ответить
@bhavanisankar71
@bhavanisankar71 - 17.06.2023 16:41

Sir please tell me how extract Text, table, images data from pdf using java. I am able to extracting text but remaining things how to get please tell me any solution

Ответить