Thursday, December 14, 2006

OPAD REQUIZ HELD ON 12TH DEC'06 (NCST Bangalore)

OPAD QUIZ
(BASED ON MEMORY)


1. Java is a
a. compiled language
b. interpreted language
c. intermediary language
d. Both 1 & 2

2. Difference between Method Overloading & Method Overriding

3. When a class B extends class A then what are the properties of A are there in B and what is the scope of both of the classes.

4. When Class B extends Class A then how we can create the object of Class B successfully.
A a= new B();

5. What are the properties of abstract and interface. What are the similarities and what are the differences

6. For each try block what are the rules to be followed

7. Reusability of code can be implemented using
a. composition
b. encapsulation

8. Given the following code:
int arr[] = new int[5];
System.out.print(arr.length);
What will be the output?

9. Mark and Sweep in Java uses which Methodology
a. BFS
b. DFS
c.Minimum Spanning Tree

10. FileWriter class. How can the data be appended to a existing file
FileWriter fw = new FileWriter("Test",True);
FileWriter fw = new FileWriter("Test",False);
FileWriter fw = new FileWriter("Test");

11. Insertion Sort complexity on a given set of data
1 3 4 9 12
a. O(N log N)
b. O(log N)
c. O(N)

12. Complexity of finding a maximum element from
a. Unsorted Array
b. Max Heap


13. There are two linklist with M and N elements each where M > N
Both linklist meet at point X. What is the complexity to reach at element X.
O(N)
O(M*N)

14. Given a graph
8 2
0------------------0----------------------0
| | | \ 3
| | | \
7| | 5 | O
| | | /
| | | / 6
0------------------0----------------------0
10 4

Apply prims algo and generate the sequence in which the nodes will be visited. Minimum Spanning Tree

15. AVL tree nodes are given as under
50, 25, 12, 75, 62, 65, 87, 99, 90
Give how many left and right rotations are needed
Ans. 3 3

16.
0------------------------------------------0
/


Apply DFS on a directed graph and give the sequence in which they will be visited. vising order was alphabetical order

17. Given a sequence of
Inorder:
Preorder
Create the Post Order of that tree.

18. Inorder Successor of a tree is
a. right most
b. left most

19. Create MinHeap and then give inorder of that.

20. for(float r=5; r!=10; r=r+0.53)

Give the output whether infinite or not

21. Sequence of following in a java program is
a. package, import, class
b. import, package, class

22. Which technique is used to travel through a Maze
a. Backtracking
b. Minimum Spanning Tree

23. When JVM runs its Garbage Collector then which method is called
a. Finally
b. Finalize
c. Final

24.