Java developer interview experience in Oracle india, Hyderabad


Himabindu scheduled interview in oracle India, Hyderabad. They were looking for strong core java developers to build their own product ADF. To crack the interview you have to solve many logical questions and algorithms,data structures. They will give enough time to write the code. In my case one person came and given 4 programs and asked to write code. In the middle he is coming and asking the logic how you are implementing. Some times they will give clues to solve the same.Following are the interview questions asked me,
  Round 1:
Most are questions are program .
1) Write singleton with lazy initialization java?
ANS:
public final class LazySingleton {
private static volatile LazySingleton instance = null;

// private constructor
private LazySingleton() {
}

public static LazySingleton getInstance() {
if (instance == null) {
synchronized (LazySingleton.class) {
instance = new LazySingleton();
}
}
return instance;
}
}
2) Write a program to check after n number of iterations of the given string is palindrome or not?
EX: String s="123456", int n=3;
Result: String s1= "456123"; check if s==s1 ?
3) Write the above program no 2 without using for loop and substring?
4) Consider there is method
public boolean isSubStr(String s1,String s2) - it returns true whenever the s2 is substring of s1 else false.
Quesion : You have given two Strings s1 and s2. By using the only the above method is s2 is rotational string of s1?
Rotational String EX 1:
Actual String :: "abc"
Rotational String :: "bca"
Rotational String EX 2:
Actual String :: "sindhu"
Rotational String :: "indhus".
5) Write a program to traverse the tree using breadth first search?
6) Write a program to find the loops in circular linked list?
7) Write a program to find the middle element of the linked list using only one loop?
8) Differences between ArrayList and Linked List?
Round 2:
1) Write a program to merge two sorted arrays as a single sorted array?
2) Print the out put show below(Diamond)?
0
0  1
0  1  2
0  1   2  3
0  1   2   3  4
0  1   2  3
0  1  2
0   1
0
3) Write a program to find the middle node of linked list with using one loop?
Rejected in Round 2.
Feel free to comment below for more queries.
www.000webhost.com