1st Round Hackerrank test. 23 min for two question.
1. Last Stone Weight
We are playing a game with the stones. On each turn, we choose the heaviest two stones and smash them together. Suppose the heaviest two stones have weights x and y with x <= y. The result of this smash is:
If x == y, both stones are destroyed, and
If x != y, the stone of weight x is destroyed, and the stone of weight y has new weight y - x.
At the end of the game, there is at most one stone left.
2. SQL query to print even rows
Second Round:
Technical Interview
Questions from hasmap implementation, equals ,hashcode contract. Spring bean scopes,rest api design, table design in oracle. Streaming api question to group a list and then get sum of one of the field
Third Round:
Hackerranck test 10 question in 95 min
Few MCQ, two java coding,one sql query
Implement Factorial using multithreading , and while calculating you need to call another method which is provided.
BST traversal ,
due to hackerranck autocomplete code error completely lost the track, by the time I realize this is an error 40 min passed.
Code was like this
class Tree{Node root, add(int value)}
class Node(int data,Node left,Node right, add(int val){
//To complete
}
public static void main(..){
// To complete
}
}
This point I got completely confused and proceed to next question by the time I come back here to write code time over.
SQL query: to print all dept name, and highest avg salary
two table