Nagarro Java Interview Questions & Answers
Вставка
- Опубліковано 8 лют 2025
- This video contains Java, Springboot, Microservices, Kafka interview questions and answers.
Accenture 1st Round Interview: • IBM Java Interview Que...
Accenture 2nd Round Interview: • Accenture | Round 2 | ...
Brillio 1st Round Interview: • Brillio | Round 1 | Ja...
Brillio 3rd Round Interview: • Brillio | Round 3 | Ja...
CGI Interview: • CGI Java Interview Que...
IBM Interview: • IBM Java Interview Que...
Concentrix Interview: • Concentrix (PKGlobal) ...
Wipro 1st Round Interview: • Wipro Java Interview Q...
Wipro 2nd Round Interview: • Wipro | Round 2 | Java...
Facebook: / javatechlead
Instagram: / javatechlead
Twitter: / javatechlead
Mail: javatechlead123@gmail.com
#java #springboot #microservices #java8 #elasticsearch #kafka #spring #javaInterviewQuestions #JavaInterviewQuestionsandAnswers #JavaInterview #CoreJavaInterviewQuestions #JavaInterviewQuestionsandAnswersForExperienced
Thanks to interviewer for spending lot of time entertaining the guy.
Why interviewer was confused for DS inside bucket? Strange 😊
How many interviews you have attended🤔
I am coming up with another video on interviews attended 👍
I didn't get the very 1st question filter employee list based on salary, if possible can you please help with question and answer...Thank you.!
package com.demo;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;
public class Demo {
public static void main(String[] args) {
HashMap empMap = new HashMap();
empMap.put("Raju", new Employee("Raju", "Java", 1000));
empMap.put("Kiran", new Employee("Kiran", "BI", 2000));
empMap.put("Suman", new Employee("Suman", "C#", 5000));
empMap.put("Ramu", new Employee("Ramu", ".Net", 10000));
System.out.println(getEmployees(empMap, 3000));
}
public static List getEmployees(HashMap empMap, int salary){
return empMap.entrySet().stream().filter(e->e.getValue().getSalary()>salary).map(e->e.getValue()).collect(Collectors.toList());
}
}
class Employee{
private String name;
private String dept;
private int salary;
public Employee(String name, String dept, int salary) {
super();
this.name = name;
this.dept = dept;
this.salary = salary;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDept() {
return dept;
}
public void setDept(String dept) {
this.dept = dept;
}
public int getSalary() {
return salary;
}
public void setSalary(int salary) {
this.salary = salary;
}
@Override
public String toString() {
return "Employee [name=" + name + ", dept=" + dept + ", salary=" + salary + "]";
}
}
Lp
L
L
Llllop ll pls p0l
L
L
@@JavaTechLead empMap.values().stream().filter(e -> e.getSalary() > salary).collect(Collectors.toList());
@@JavaTechLead great one and I'm having a question so there is no usage of key mention in the question so can't we directly create a stream of values which reduce the use of map function in the stream pipeline.
private static List returnEmp(HashMap map) {
List list = new ArrayList();
for(Map.Entry newMap : map.entrySet() ){
if(newMap.getValue().salary>9000){
list.add(newMap.getValue());
}
}
return list;
}
were thr DS based questions in Nagarrow ?
It's based on the role.
Ans to first question : empMap.entrySet().stream().filter(e->e.getSalary()>20000).map(e->e.getValue()).collect(Collectors.toList());
Correct one would be as below.
empMap.entrySet().stream().filter(e -> e.getValue().getSalary() > 20000).map(e -> e.getValue()).collect(Collectors.toList());
Can we use keyset()
@@veerendrakumarmeka3181 using keySet() here will allow to stream and process Keys only...So, we won't get the desired results.
empMap.values().stream().filter(e -> e.getSalary() > 20000).collect(Collectors.toList());
You cleared?
Nyc
Tq bro
how many rounds bro?
3 rounds
Got selected in Nagarro??
Yes
Congratulations @JavaTechLead