All Possible java 8 Stream API questions asked in interview | Java 8 features

preview_player
Показать описание
It covers all the possible questions can be asked in interview :

Questions Based on Array and Strings:

1.Given a list of integers, find out all the even numbers that exist in the list using Stream?
2.Given a list of integers, find out all the numbers starting with 1 using Stream ?
3.How to find duplicate elements in a given integers list in java using Stream ?
4.Given the list of integers, find the first element of the list using Stream ?
5.How to remove duplicates from a list while preserving the order using Java streams?
6.Given a list of integers, find the maximum value element present in it using Stream ?
7.Given a list of integers, sort all the values present in it using Stream ?
8.Given a list of integers, sort all the values present in it in descending order using Stream ?
9.Java 8 program to perform cube on list elements and filter numbers greater than 50 ?
10.Find the kth smallest element in an array using java streams ?
11.Given a String, find the first non - repeated character in it using Stream ?
12.Given a String, find the first repeated character in it using Stream ?
13.How to find frequency from the String list in Java8 ?
14.How to find only duplicate elements with its count from the String ArrayList in Java8 ?
15.Find the longest string in a list of strings using Java streams?

Question Based on Eemployee Object:

1.Group the Employees by city.
2. Find the count of male and female employees present in the organization.
3. Print the names of all departments in the organization.
4.Print employee details whose age is greater than 28.
5.Find maximum age of employee.
6.Print Average age of Male and Female Employees.
7.Print the number of employees in each department.
8.Find the oldest employee.
9. Find the youngest female employee.
10. Find employees whose age is greater than 30 and less than 30.
11.Find the department name which has the highest number of employees.
12.Find if there is any employees from HR Department.
13.Find the department names that these employees work for, where the number of employees in the department is over 3.
14. Find all employees who lives in ‘Blore’ city, sort them by their name and print the names of employees.
15.Find the department which has the highest number of employees.
16.Sorting a Stream by age and name fields.
17.Print average and total salary of the organization.
18.Print Average salary of each department.
19. Find Highest salary in the organisation.
20.Find the second-highest salary in the organisation.
Рекомендации по теме
Комментарии
Автор

Nicely covered all Java stream API questions

starff-xsdm
visit shbcf.ru