Most Commonly asked Java8 Stream based Interview Question — Part 1

Amar Balu
The Fresh Writes
Published in
5 min readFeb 16, 2023

--

Hello there, I hope everyone is doing well.

This article will help you to get some idea about how Stream based interview questions will be asked.

Image Source : https://javadeveloperzone.com/spring-boot/spring-boot-tutorial/

I will be sharing here some common questions asked along with its answers. In most of the questions, you will be asked to create a List of Custom Object.

Example
Employee Class with Employee Object having data about Employee like emp_id, salary, name, Date_of_Joining, Designation.
Student Class with student Object having data about Student like student_id, name, class, Stream, Date_of_birth.

The Questions will be then based on this List of Objects.

Implementation Example

Here I am creating an Employee class.

public class EmployeeObject {
int emp_id;
String emp_name;
int emp_age;
String emp_gender;
String emp_dep;
int year_of_joining;
double emp_salary;


public EmployeeObject(int emp_id, String name, int age, String gender, String department, int year_of_joining,
double salary) {
this.emp_id = emp_id;
this.emp_name = name;
this.emp_age = age;
this.emp_gender = gender;
emp_dep = department…

--

--

Amar Balu
The Fresh Writes

I'm a front-end developer. I love React and Redux, Java, and Data Science. I write code for fun!. Join our publication : https://medium.com/thefreshwrites