Thursday, June 30, 2016

Cognizant

Round 1 Programs:

* Write a strategy which can be used to sort Employee object by age/first_name/last_name if no strategy is provided sort it by age.
* Write a program to create Deadlock.
* Write a program to print Fibonacci series.
* There are 2 threads T1 and T2.. T1 prints odd number 1,3,5,7 and T2 prints event number 2,4,6,8. Write a program using threads which will print following:
   1,2,3,4,5,6,7,8
* Write a program which will to sort Employee collection may be using merge sort.

Interview Round 1  and  2:

* What is ConcurrentHashMap?
* How to avoid reading from segment if some other thread is writing to same segment?
* What is difference between volatile and atomic? Which one should be used when?
* What is WeakHashMap?
* How to find deadlock in live code?
* What is Task?
* What is RentrantLock?
* What is livelock?
* Livelock is good or bad?
* Difference between aggregation and composition.
* What is difference between LinkedList and LinkedHashSet?
* What are the disadvantages of Threads?

Sela Question

Q1] what is java
ans : ddddd
Q2]