You are on page 1of 8

Zopsmart Interview Questions

1) Given a distance, count the total number of ways to cover the distance with 1, 2 and 3
steps.
Examples:
Input: n = 3
Output: 4
Explanation:
Below are the four ways

1 step + 1 step + 1 step


1 step + 2 step
2 step + 1 step
3 step

Input: n = 4
Output: 7
Explanation:
Below are the four ways
1 step + 1 step + 1 step + 1 step
1 step + 2 step + 1 step
2 step + 1 step + 1 step
1 step + 1 step + 2 step
2 step + 2 step
3 step + 1 step
1 step + 3 step

2) Given a Binary Tree, we need to print the bottom view from left to right

Examples:
20
/ \
8 22
/ \ \
5 3 25
/\
10 14
For the above tree the output should be 5, 10, 3, 14, 25.
20
/ \
8 22
/ \ / \
5 34 25
/\
10 14
For the above tree the output should be 5, 10, 4, 14, 25.

3) Given twio Linked lists joining at one node. Identify the joining node.

H1 1 2 9 4 5 6
12 13 14
H2 7 8 9 10 11

Cognizant Interview Questions

1) Why you have used Postgres DB in your project ? Any major reasons
2) I have developed one microservice in .net and can I consume it from another micro service which
was developed in JAVA ?
3) What is Polymorphism ?
4) How you will acheive Polymorphism (Explanations) ?
5) What is JPA ?
6) Why spring boot ?
7) What is the default scope for Java Bean ?
8) What are the design patterns that you know ?
9) Can you explain your current project in depth (functionalities and how you will acheive that) ?
10) What are observables and promises ?
11) Can you explain about lifecycles in Angular ?
12) You have one method in class A. Class B is extending A and overriding that method. I have
created child class object and call the overriden method. In this case why should I extends A from
B.

SapphireIMS Interview Questions


1st Round (Technical Round)
1) Write a program to read a file and count the number of lines and words in a file.
2) write a program to find indexes of Array those sum is equl to given number. There might be more
than two indexes that should return the sum as given Number
Ex: int[] intArry ={5,4,6,2,8,9};
Number is 7
output is 0,3
3) What are Wrapper classes ?
4) What is dead lock ?
5) Write a program that should results in dead lock

2nd Round (Managerial Round)


1) In depth explanation of current project.
2) some cross questions on projects(How you will design tables for roles for your peoject)
3) You have 3 services A, B, C. A is calling B which in turn calls C and you are inserting some data
in each service for a particular request. Lets say A->B call is success full and data is inserted
properly. Now B-> C is failed due to some error. How will you are roll back and prevent the data
loss in this case ?
Nagarro

1st Round(Technical Round)

1) How good are you in java 8 ?


2) What is functional interface and why do you want to go for it ?
3) What is Serializable interface ?
4) What is uuid in Serializable interface ?
5) How do you call one micro service from another micro service ?
6) Is that call loosely coupled or tightly coupled ?
7) what are the different bean scopes available ?
8) What is loose coupling ?
9) What is Databinding anf types ?
10) What is an Observable ?
11) What is composite key ?
12) What is view in SQL ?
13) What is @RestController ?
14) What is Dependency Injection ?
15) You have an Employee class and you need to insert Employee Objects into Map. What and all
you need to take care of ?
16) can an foreign key be part of composute key ?

GE(Wabtec)

1) Life cycle hooks in Angular


2) Write an example for Functional Interface
3) Find sum of numbers in a list using streams
4) Write a test case for mocking the object for sum of numbers in a list using streams
5) RXJS examples
6) Authenticationa and Authorization in java
7) Dependency Injection in Angular and how will you do that ?
8) sort the Integer values present in an Array lit using java 8 features

Deloitte and NTTData

1) Features of Java 8 and explain each feature


2) Optional feature indepth

class Employee {
String name;
int id;
//setters and getters
}

Employee obj = null;


null.getName(); // will results in NullPointerException
How will you avoid this Exception using Optional
3) Explain OOPS concepts with one real time example for each
4) Output for the following codes:

for(int i=0;1;i++) {
System.out.println("Naveen");
}

for(int i=0;true;i++) {
System.out.println("hi")
}
class Parent {
public void m1(Object o) {
System.out.println("Parent class m1() method");
}
}

class Child extends Parent {


public void m1(String s) {
System.out.println("Child class m1() method");
}
}

class Test {
public static void main(String[] args) {
Parent p = new Child();
p.m1(null);
}
}

====

class Parent {
public void m1() {
System.out.println("Parent class m1() method");
}
}

class Child extends Parent {


public void m1() {
System.out.println("Child class m1() method");
}
}

class Test {
public static void main(String[] args) {
Parent p = new Child();
p.m1();
}
}

6) What is Functional Interface ?


7) Can you create one Functional Interface and give the implementation for that using lambda
expressions ?
8) What is Hibernate ?
9) Can you explaing cache mechanism in Hibernate ?
10) Bean scopes in spring framework ?
11) If any object is stored in first leval cache what is the scope of that object ?
12) What is the default scope for the bean in spring/spring boot ?
13) How to change the scops of the beans ?
14) What is @Qualifier annotation ?
15) What are the design patterns you have worked on ?
16) What is single ton design pattern in spring framework and how is it differs from normal
singleton design class ?
17) What is sessionfactory in Hibernate ?
18) What is index in SQL ?
19) How to return nth highest salary in SQL ?
20) How to write Native queries in JPA ?
21) Can we have multiple Session Factories in a single application ?
22) Explain internal working of Hashmap ?
23) What is covarient return type ?
24) What are solid principles in java ?
25) If you inserting Employee objects into HashMap what and all things you need to take care of ?
26) What is Circuit breaker design pattern ?
27) What is API gateway design pattern and how will you design API gate way for your
application ?
28) What is Even driven architecture ?
29) What is Actuator ?
30) Explain about spring profiles ?
31) You have developed an application and deployed into AWS. Single instance is running and it is
capable of handling 500 requests at a time. Tomorrow you have 2000 requests coming into your
application and you have scaled up your instances upto 4 instances using AWS load balancing. and
Later next day you have only 500 requests coming in. Now will the 3 instances will be scaled down
automatically or how it will behave ?
32) What is Docker file ?
33) Difference between Spring and Spring Boot and which one you will prefer and why ?
34) why wait() and notify() method are present inside Object class though they were related to
Threads.
34) How many ways to create Threads and which one is preferable and why ?
35) What is Callable Interface ?
36) Serialization and indepth questions
37) How will you check your logs in your application ?
38) What do we call the return type of run() inside Callable interface ?
39) Some questions on below code:

class Employee {
name, id
//setters and getters
}
main() {
List<Employee> list = new ArrayList<Employee>(); //e1 = 2000 e2 = 3000
Employee e1 = new Employee("Manoj", 5042);
Employee e2 = new Employee("Naveen", 5041);
Map<Employee, Integer> map = new HashMap<>();
map.put(e1, 5042);
map.put(e2, 5);
e2.setName("Naveen");
map.get(e2);
list.stream().filter(emp -> emp.getName().startsWith("a") && (emp.getId() <= 1500 &&
emp.getId()>=1000)).collect(Collectors.toMap()); //collect this into map
Set<Employee> set = new TreeSet<>()
set.add(e1);//will this work
set.add(e2);
}

40) Given 3 tables, on certain criteria write a query to perform Join operation
41) What is proxy object ?
42) What is the difference between load() and get() in Hibernate ?
43) Difference between Map, Set, List ?
44) Difference between Arrays and List ?
46) Explain different types of joins ?
47) What is self join ?
48) If there are two GET requests with the same API and both results in Exception, which request
will raise Exception first ?
49)

You might also like