Impetus Interview on (17-07-2022)

1). Which one to use Runnable or Thread? Reason.

When extending the Thread class, we're not overriding any of its methods. Instead, we override the method of Runnable (which Thread happens to implement). This is a clear violation of IS-A Thread principle Creating an implementation of Runnable and passing it to the Thread class utilizes composition and not inheritance – which is more flexible After extending the Thread class, we can't extend any other class From Java 8 onwards, Runnables can be represented as lambda expressions


2). What is semaphore?
3). What is Object and class level lock?
4). Memory structure change in HashMap?
5). Put vs Patch? what is idempotent?
6). Circuit breaker design pattern?
7). Cyclic dependency in the LinkedList?
8). Where you have used Builder design pattern?
9). when to use parallel or simple stream?
10).Reason for string immutability?
11).Sum of the salary of each department alnog with the employee name list.
12).Why child can't hold the parent object?
13).If two interfaces have same default method what will happen if you implement them at the same time?
14).Why to use java8 Date APIs when java7 already have Calander and All?

Nagarro Interview on (DD-07-2022)

1). Atomic Integer.
2). Executor Service.
3). Perfact Immutable class.
4). How Tracer works.
5). Remove duplicates from List , without using dictinct or Set.
6). Exception handling without try catch and @ControllerAdvice.
7). Transaction rollback in microservices.(M1->M2->M3, Request failed at M3, Rollback All)
8). Fault tollerance in microservices.
9). Using Predicate in the if condition.
10). Equals and HashCode deep dive.
11). Streams deep dive.

Capgemini Interview on (DD-07-2022)

1). How to design immutable class.
2). How to mock rest call in junit.
3). findOne vs findById.
4). What is functional interface.
5). static and default methods in interface
6). comparable vs comparator.
7). What is join in multithreading.
8). What is concurrent hashmap.
9). What is terminal operator in java stream.
10). recent log4j issue
11). trigger vs sequence.
12). what is flatMap method
13). what is volatile keyword.
14). Multi threading
15). Map sorting
16). Driver manager JDBC
17). Remove duplicates using stream
18). How distinct work
19). Second max in a array
20). What is Callable.

TCS Interview on (DD-06-2022)

1). @queryparam vs @requestparam
2). How lambda works.
3). Volatile.
4). Resource sharing in multithreading
5). Metaspace
6). New memory management in Java8.
8). Atomic Integer
9). Mutable object in immutable class.
10). null key in hashMap, treeMap and hashTable
11). POST, PUT and PATCH method.
12). Types of Autowiring
13). @Resource vs @Autowired
14). @JpaRepository vs @CrudRepository.
15). Return type HashMap and HashSet put, add method.