SAP interview question

How is the memory in java sectioned? How can you create a dead lock? what is the java thread lock? What is dijkstra? How many locks there are in a database? recursion -> fibonacci numbers, power of two (and bitwise). Create OO architecture of the animal kingdom

Interview Answer

Anonymous

2 Jun 2015

How is the memory in java sectioned? -> eden, tenured, survivor spaces; perm gen, non-cache How can you create a dead lock? - > with semaphores, allocate a semaphore, but do not release, what is the java thread lock? -> did not understand the question, suppose I should've said the java.util.concurrent.locks objects which support wait/notify ... What is dijkstra? -> an algorithm for finding the shortest path in graph How many locks there are in a database? -> have no idea recursion -> fibonacci numbers, power of two (and bitwise). int fibonacci(int n) { if(n == 0) return 0; else if(n == 1) return 1; else return fibonacci(n - 1) + fibonacci(n - 2); long power(int a, int n){ if (n == 0) return 1; return a* power(a,n-1); } long powerBit(int n){ return 1 << n; } Create OO architecture of the animal kingdom