Java 8 Programming/Coding interview Question and Answers with Sort Limit and Skip | Code Decode
ฝัง
- เผยแพร่เมื่อ 5 ก.ย. 2024
- In this video of code decode we have covered Java 8 scenario based coding interview questions and answers for both freshers and experienced
Udemy Course of Code Decode on Microservice k8s AWS CICD link:
openinapp.co/u...
Course Description Video :
yt.openinapp.c...
Most Asked Core Java Interview Questions and Answers : • Core Java frequently a...
Advance Java Interview Questions and Answers : • Advance Java Interview...
Java 8 Interview Questions and Answers : • Java 8 Interview Quest...
Hibernate Interview Questions and Answers : • Hibernate Interview Qu...
Spring Boot Interview Questions and Answers : • Advance Java Interview...
Angular Playlist : • Angular Course Introdu...
SQL Playlist : • SQL Interview Question...
GIT : • GIT
Subscriber and Follow Code Decode
Subscriber Code Decode : www.youtube.co...
Linkedin : / codedecodeyoutube
Instagram : / codedecode25
#codedecode #java8shortcicrcuit #javainterviewquestionsandanswers
Only Because of this channel I got 8.5 lakhs package in just 1 month with 2 years of experience. Thank you very much 👍🔥
Many congratulations Ajay. Well deserved 🎊🎊🎉🎉. Keep learning keep rocking Man 👍👍
Great.congrats.
I m also preparing for the same..
Hi @Ajay krishna did u have real world exp in Java or with u showed fake experience
@@anuragarora2960 this is sure that you are applying on fake experience...hahaaaa...myself too...
could you please share your resume, and also which company
Your explanation quality is good 👍 I always prefer live demo to understand any concept ☺️ Appreciate your work 🙏
Thanks Piyush 🙂🙂👍👍
Very well explain. Thank you. If possible can you please make one video on most asked java 8 program using Stream API. a) Find Number of occurrences of all char in string using Streams.
Simple way :
List descSortList = employeeList.stream()
.sorted(Comparator.comparing(Employee::getSalary).reversed())
.limit(3)
.toList();
Thank you so much madam I am learning a lot of content from your channel videos this was very helpful please do more videos on coding interview questions which will help us in cracking interviews
Thank you
Thanks Uday. Sure we will do that🙂🙂👍👍
Hi, I cleared the interview of sapient which was of around 2.5 hrs because of your videos. Thank you. Hope i get offer letter soon.
Thank you codedecode because of you.. I cracked lots of interview got appropriate package as well as..
Great, I have become fan of you and your videos...
Thanks a tonn Balkrishna. Glad to have you aboard 🙂🙂👍👍
Expecting more on this content especially your explanation on limit(),skip() gives me clear picture on usage of such methods and it is really different from my point of understanding what i read from websites with examples.Thanks a lot team and it will good if you do on peek(),reduce() and also on parallel streams etc.
All these videos are already created Dinesh: th-cam.com/video/1Cs7X-JYkTY/w-d-xo.html
Like always...this channel is a blessing in disguise 🙂...
Need some more Java 8 interview questions...
Thanks Abhishek🙂😃👍👍. Sure we will upload them soon
Really All your videos are good and easy to understand. . Thankyou team....
Thanks Bhuvana🙂
Please cover more java 8 programing question.
Very well explained thanks alot
Sure Swapnil we will do that. Thanks 🙂👍👍
Thank you so much for such good contents. Looking forward for more such videos on JAVA8 programming.
Thanks Silpa. We do have many of them covered here -
th-cam.com/play/PLyHJZXNdCXsdeusn4OM33415DCMQ6sUKy.html
Wonderful explanation 👏 Thanks for all the efforts !!
Thanks 🙂🙂👍👍
Nice explanation.. I have faced these questions in the interview. Can you also list employees in sorting order based on name and salary.
Thanks Ravindra. Sure we will include these too In same question 👍🙂😃
@@CodeDecode I have used Comparator.comparing().thenComparing(). Please let us know if any alternate solution available.
That question was already covered in this channel. Once go through all videos.
Thank you for putting efforts in providing the awesome content with in detailed explanation & demo. As far as this video's concerned, usage of skip & limit as a combination is something that is missed I guess(which might be useful for getting nth highest salary ).
Could you please make a tutorial or interview questions video(s) for MyBatis as well in near future.
Thanks
Sure thanks 👍🙂
@@CodeDecode Hi.. are you maintaining all these material in GitHub or somewhere else ? If yes could please provide the link so that it will be easy for us(the viewers) to refer it quickly.
Thanks
I have a question, For last problem what if some employee have the same salary. then how we can fetch ?
I too have the same doubt. Not only in the last case, In case of first 3 highest salaried employees also, we can't get expected output with limit and skip. How to overcome this problem. Please explain @CodeDecode
Code decode Team - Because of your content even today I cleared interview of a very good company, have got so many offers. You guys are really awesome - no words to appreciate 🙂
//Please explain how to Write Java 8 program to return word as a list value and its length as a key in descending sorting
order from below sentence, -Input => String statement = "Hello World My name is Jane and I hate Mango Fruit";
Output=> {5 = [“Hello”, “World”, “Mango”, “Fruit”], 4 = [“name”, “Jane”, “hate”],
3 = [“and”], 2 = [“My”, “is”], 1 = [“I”]}
Pseudo code :
Split string by space, create list from array of string.
Open stream on list
Group by string's length n values will become list of all strings of that length👍
That's pseudo code. If you want we will create a video on this👍
@@CodeDecode Please provide complete code for this
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
public class ReturnWordAsList {
public static void main(String[] args) {
String input = "Hello world my name is jane and I hate mango fruit";
String[] split = input.split(" ");
collect = Arrays .stream(split) .collect(Collectors.groupingBy(String::length));
System.out.println(collect);
/* * output : * * {1=[I], 2=[my, is], 3=[and], 4=[name, jane, hate], 5=[Hello, world, mango, * fruit]} */ } }
====== Will the following program work ?
You don't have any IDE available with you?
Using employee object find who have employee I'd is even and salary is greater than 50000 using java 8 features
how much package i achieve(As a fresher java developer) if i watch your all video of java ?❓❓❓
Hi, Your videos helped me alot during my interview. I have a question for you in streams, Please provide me the answer in the comment and also please do the videos for such questions.
Ques: There is an Employee class with id, Name. Write a code using java 8 to replace the name of those employees with id 4 and collect them to a employee object
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
class Employee {
private int id;
private String name;
public Employee(int id, String name) {
this.id = id;
this.name = name;
}
public int getId() {
return id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public String toString() {
return "Employee{" +
"id=" + id +
", name='" + name + '\'' +
'}';
}
}
public class EmployeeExample {
public static void main(String[] args) {
List employees = Arrays.asList(
new Employee(1, "John"),
new Employee(2, "Jane"),
new Employee(3, "Bob"),
new Employee(4, "Alice"),
new Employee(5, "Charlie")
);
List updatedEmployees = employees.stream()
.map(employee -> {
if (employee.getId() == 4) {
employee.setName("NewNameForEmployee4");
}
return employee;
})
.collect(Collectors.toList());
updatedEmployees.forEach(System.out::println);
}
}
Hi code decode
Just give us complete knowledge with java 8 intermediate functions how types are there and how to use them
Every thing that you need is already covered. Please have a look at th-cam.com/play/PLyHJZXNdCXsdeusn4OM33415DCMQ6sUKy.html
make interview question aws/gcp also
Thank you good video pls make one more video
Sure we will create it soon
Thank you for such good explanation ❤❤
You're welcome 😊
Hello queen u dropped this 👑
Thank you so much for this wonderful content. Your target was 500 like but its 625 now including mine. Really appreciated your hard work to clear the concept of java streams. Kindly make videos on kafka. There is no content available on youtube regarding that. Will help you as well as subscribers.
sure maninder we will upload video on kafka in near future
Hi code decode expecting a reply and a video for the following question
How do different roles provided to different users like admin and others
And how the username password validation is working and how to implement
Answer to both is- spring security. Answer 1 - Role based authentication and authorization
Answer 2-you can do this in y your custom spring security class which extend web security configuration adapter.
Sure these are awesome topics. We will create videos on both👍👍🙂🙂
Pls cover terminal and intermediate operations using stream with map,filter,flatMap,
sure rajkumar we will create it soon
Good explanation but please keep video export quality good, it is hazy in big screen.
Sure. Thanks for getting this issue to our notice.
Thanks for this. Helpful
Please print non repeated characters in a string using Java 8 features
List sortedList = employeeList.stream()
.sorted(Comparator.comparingLong(Employee::getSalary))
.limit(3)
.collect(Collectors.toList());
👍
Thanks , explaind realy well..i was asked to get second highest .if i use limit(2)will that work can u explain on this please
are these questions asked for fresher java developer role in interview
Thanks ton..only second maximum highest salary..
🙂🙂👍👍
@@CodeDecode please make vedio maxby or minby and map and flatmap operations.. please
Use limit (2).skip(1) you will get it
If we have more than 5 properties then Can we sort more than 3 property of employees class ??
Pls make more videos on java8 streams coding questions
Sure Mamatha 🙂👍we will do that
Please make a website for all your tutorial video's
Sure prasanna things are in process. We will update once it will get created
Please upload more java8 interview questions
sure srinivas we will upload it soon
I got same question and I got rejected kash pahle video dakh lati
what if i want only 3 rd highest salary , am i think like thing skip 2 and limit 1 right is this correct
Doing great Job Yashi :)
Thanks Somil 🙂
Hi,
Could you please share the PPT or doc
used in the tutorials used in Spring Boot and microservices videos so that it could help in revision?
Or let me know if you have uploaded it somewhere
or can we get it by joining the membership?
Thanks in advance
Hello. Everything we covered is given in the description below . Anything else is needed?
@@CodeDecode Thank you so much for your response. I am sorry but the details which I asked for microservices and Spring Boot PPT or Doc which are covered in those videos isn't mentioned in any of the videos description. It would you great if you could share PPT or doc for the same, it would help in revising for the interviews.
I also face this type of coding challenge. They ask me to print all the employees whose salary is greater than 5th highest employee salary in list. So I answer this question.
Yepp it's commonly asked question Ajay 🙂👍
This kind of questions can be asked pertaining to how may yrs of experience candidates?
From any candidate who had written java 8 in their resume Himanshu👍👍
HI HOW WE MODIFY THE DATA BASED ON CONDTION LIKE BASED ON GRADE HOW WILL INCREASE SALARY 10 percentage..THANKS IN ADVANCE
can we have microservices related content ? thanks in advance
Sure Deepak. We will put more videos on microservices
Thanks 👍
You're welcome
Sorted.comparator how you use tell bro
superb
Thanks Himanshu 🙂🙂👍👍
These are basic interview question based on java 8.
Java 8 Coding Interview Questions (Most Asked): th-cam.com/play/PLyHJZXNdCXsfcMboYwGoL6wKAFPxljz5W.html
Here you go Ankit
👌
Can I get the source code sis
Please post more java 8 coding questions
Sure Shanmugam 👍👍