71

Click here to load reader

Complete Oracle Paper

Embed Size (px)

Citation preview

Page 1: Complete Oracle Paper

http://worldatyou.blogspot.com/

http://worldatyou.blogspot.com/

Page 2: Complete Oracle Paper

http://worldatyou.blogspot.com/

Coding Skills (Advanced)

Question Number 1

Given the following code snippet:

void InsertNode(tNode** node, int i){ if(*node == NULL){ *node = new tNode; (*node)->pLeft = NULL; (*node)->data = i; (*node)->pRight = NULL; SetRootNode(node); return; } else{ if(i < (*node)->data) InsertNode(&((*node)->pLeft), i); if(i > (*node)->data) InsertNode(&((*node)->pRight), i); return; }}

void Func(tNode **node){ if(*node!=NULL){ Func(&(*node)->pLeft); tNode *temp; temp = (*node)->pLeft; (*node)->pLeft= (*node)->pRight; (*node)->pRight = temp; Func(&(*node)->pRight); }}void traverse(tNode** nd){ if(*nd!=NULL){ traverse(&((*nd)->pLeft)); traverse(&((*nd)->pRight)); std::cout<<(*nd)->data<<std::endl; }}

Let the input given be98,15,100,10,78,120,5,12,96,110

What would be the output of the following code snippet?

int main(void){ tree *bT = new tree; int i = 10; int data; while(i--){

http://worldatyou.blogspot.com/

Page 3: Complete Oracle Paper

http://worldatyou.blogspot.com/

std::cout<<"Enter the node"<<std::endl; std::cin>>data; bT->InsertNode(bT->GetRootNode(), data); } bT->InsertNode(bT->GetRootNode(), 99); bT->traverse(bT->GetRootNode());}

110,5,12,96,78,15,99,110,120,100,985,10,12,15,78,96,98,99,100,110,120120,110,100,99,98,96,78,15,12,10,598,100,120,110,99,15,78,96,12,5,110

Question Number 2

Given the following code snippet:

void InsertNode(tNode** node, int i){ if(*node == NULL){ *node = new tNode; (*node)->pLeft = NULL; (*node)->data = i; (*node)->pRight = NULL; SetRootNode(node); return; } else{ if(i < (*node)->data) InsertNode(&((*node)->pLeft), i); if(i > (*node)->data) InsertNode(&((*node)->pRight), i); return; }}

void Func(tNode **node){ if(*node!=NULL){ Func(&(*node)->pLeft); tNode *temp; temp = (*node)->pLeft; (*node)->pLeft= (*node)->pRight; (*node)->pRight = temp; Func(&(*node)->pRight); }

http://worldatyou.blogspot.com/

Page 4: Complete Oracle Paper

http://worldatyou.blogspot.com/

}void traverse(tNode** nd){ if(*nd!=NULL){ traverse(&((*nd)->pLeft)); traverse(&((*nd)->pRight)); std::cout<<(*nd)->data<<std::endl; }}

Let the input given be98,15,100,10,78,120,5,12,96,110

What would be the output of the following code snippet?

int main(void){ tree *bT = new tree; int i = 10; int data; while(i--){ std::cout<<"Enter the node"<<std::endl; std::cin>>data; bT->InsertNode(bT->GetRootNode(), data);

}bT->Func(bT->GetRootNode()); bT->InsertNode(bT->GetRootNode(), 99);bT->Func(bT->GetRootNode()); bT->traverse(bT->GetRootNode());}

5,10,12,15,78,96,98,99,100,110,1205,12,10,99,96,78,15,110,120,100,985,10,12,15,78,96,99,98,100,110,12098,100,120,110,15,78,96,99,10,12,5

Question Number 3

Given the following code snippet:

void InsertNode(tNode** node, int i){

http://worldatyou.blogspot.com/

Page 5: Complete Oracle Paper

http://worldatyou.blogspot.com/

if(*node == NULL){ *node = new tNode; (*node)->pLeft = NULL; (*node)->data = i; (*node)->pRight = NULL; SetRootNode(node); return; } else{ if(i < (*node)->data) InsertNode(&((*node)->pLeft), i); if(i > (*node)->data) InsertNode(&((*node)->pRight), i); return; }}

void Func(tNode **node){ if(*node!=NULL){ Func(&(*node)->pLeft); tNode *temp; temp = (*node)->pLeft; (*node)->pLeft= (*node)->pRight; (*node)->pRight = temp; Func(&(*node)->pRight); }}void traverse(tNode** nd){ if(*nd!=NULL){ traverse(&((*nd)->pLeft)); traverse(&((*nd)->pRight)); std::cout<<(*nd)->data<<std::endl; }}

Let the input given be98,15,100,10,78,120,5,12,96,110

What would be the output of the

http://worldatyou.blogspot.com/

Page 6: Complete Oracle Paper

http://worldatyou.blogspot.com/

following code snippet?

int main(void){ tree *bT = new tree; int i = 10; int data; while(i--){ std::cout<<"Enter the node"<<std::endl; std::cin>>data; bT->InsertNode(bT->GetRootNode(), data); } bT->Func(bT->GetRootNode()); bT->InsertNode(bT->GetRootNode(), 99); bT->traverse(bT->GetRootNode());}

100,110,120,98,5,10,12,15,78,96,9999,96,78,15,12,10,5,98,120,110,100110,120,100,5,12,10,99,96,78,15,9898,15,78,96,99,10,12,5,100,120,110

Question Number 4

Given the following code snippet:

void InsertNode(tNode** node, int i){ if(*node == NULL){ *node = new tNode; (*node)->pLeft = NULL; (*node)->data = i; (*node)->pRight = NULL; SetRootNode(node); return; } else{

http://worldatyou.blogspot.com/

Page 7: Complete Oracle Paper

http://worldatyou.blogspot.com/

if(i < (*node)->data) InsertNode(&((*node)->pLeft), i); if(i > (*node)->data) InsertNode(&((*node)->pRight), i); return; }}

void Func(tNode **node){ if(*node!=NULL){ Func(&(*node)->pLeft); tNode *temp; temp = (*node)->pLeft; (*node)->pLeft= (*node)->pRight; (*node)->pRight = temp; Func(&(*node)->pRight); }}void traverse(tNode** nd){ if(*nd!=NULL){ traverse(&((*nd)->pLeft)); traverse(&((*nd)->pRight)); std::cout<<(*nd)->data<<std::endl; }}

Let the input given be98,15,100,10,78,120,5,12,96,110

What would be the output of the following code snippet?

int main(void){ tree *bT = new tree; int i = 10; int data; while(i--){ std::cout<<"Enter the node"<<std::endl; std::cin>>data; bT->InsertNode(bT->GetRootNode(), data); }bT->InsertNode(bT->GetRootNode(), 97); bT->Func(bT->GetRootNode()); bT->InsertNode(bT->GetRootNode(), 99); bT->traverse(bT->GetRootNode());}

98,15,78,96,97,99,10,12,5,100,120,110

110,120,100,5,12,10,99,97,96,78,15,98

100,110,120,98,5,10,12,15,78,96,97,99

None of these

http://worldatyou.blogspot.com/

Page 8: Complete Oracle Paper

http://worldatyou.blogspot.com/

Question Number 5

The subject of these questions is an unusually simple kind of binary tree, defined by these properties:

Terminal nodes contain a string. Internal nodes have one or two children, called "left" and "right".

Either child of an internal node may be null, but not both.

Internal nodes contain no other information.

By "tree" we simply mean a node and all of its descendants.

A tree rooted at a node having left child A and right child B is a different tree than one rooted at a node having left child B and right child A.

Here's an example, with plus signs (+) used to indicate internal nodes:

+ / \ / \ / \ + + / / \ / / \ / / \ "A" + "D" / \ / \ / \ "B" "C"

Suppose we want the classes to implement getLeft and getRight to allow external code to navigate the tree. What should their return type be?

Object

Node

InternalNode

TerminalNode

Question Number 6

http://worldatyou.blogspot.com/

Page 9: Complete Oracle Paper

http://worldatyou.blogspot.com/

The subject of these questions is an unusually simple kind of binary tree, defined by these properties:

Terminal nodes contain a string. Internal nodes have one or two children, called "left" and "right".

Either child of an internal node may be null, but not both.

Internal nodes contain no other information.

By "tree" we simply mean a node and all of its descendants.

A tree rooted at a node having left child A and right child B is a different tree than one rooted at a node having left child B and right child A.

Here's an example, with plus signs (+) used to indicate internal nodes:

+ / \ / \ / \ + + / / \ / / \ / / \ "A" + "D" / \ / \ / \ "B" "C"

Should InternalNode have simple “setters”, as follows?

void setLeft(Node nd) { left = nd;}

void setRight(Node nd) { right = nd;}

Yes

Optional—the specifications don’t imply either yes or no

No—the specifications directly forbid it

No—the specifications don’t say one way or another but these implementations are inadequate

http://worldatyou.blogspot.com/

Page 10: Complete Oracle Paper

http://worldatyou.blogspot.com/

Question Number 7

The subject of these questions is an unusually simple kind of binary tree, defined by these properties:

Terminal nodes contain a string. Internal nodes have one or two children, called "left" and "right".

Either child of an internal node may be null, but not both.

Internal nodes contain no other information.

By "tree" we simply mean a node and all of its descendants.

A tree rooted at a node having left child A and right child B is a different tree than one rooted at a node having left child B and right child A.

Here's an example, with plus signs (+) used to indicate internal nodes:

+ / \ / \ / \ + + / / \ / / \ / / \ "A" + "D" / \ / \ / \ "B" "C"

Consider this implementation of toString():

abstract class Node { String toString();}

class TerminalNode extends Node { String toString() { return value; }}

class InternalNode extends Node { String toString() { if (null == left) return "[" + right + "]"; else if (null == right) return "[" + left + "]"; else

http://worldatyou.blogspot.com/

Page 11: Complete Oracle Paper

http://worldatyou.blogspot.com/

return "[" + left + " " + right + "]"; }}

Under what conditions will this implementation distinguish (i.e. produce different strings for) two trees that have the same strings in the same sequence in their terminal nodes but different internal structures?

Never

Only for “full” trees (ones in which every internal node has two children, except possibly the parent of the rightmost terminal node)

Always

Question Number 8

Given the following code snippet answer the following question.

struct AVLTree{ AVLTree * left; AVLTree * right; int element; int height;};int MAX(int a, int b){ if(a>=b) return a; if(a<b) return b;}int height(AVLTree *node){ if (node == NULL) { return -1; } else { return node->height; }}AVLTree * single_rotation_with_left(AVLTree *k2){ AVLTree *k1; k1 = k2->left;

http://worldatyou.blogspot.com/

Page 12: Complete Oracle Paper

http://worldatyou.blogspot.com/

k2->left = k1->right; k1->right = k2; k2->height = MAX(height(k2->left), height(k2->right)) + 1; k1->height = MAX(height(k1->left), height(k2->right)) + 1; return k1;}

AVLTree * single_rotation_with_right(AVLTree *k2){ AVLTree *k1; k1 = k2->right; k2->right = k1->left; k1->left = k2; k2->height = MAX(height(k2->left), height(k2->right)) + 1; k1->height = MAX(height(k1->right), height(k2->left)) + 1; return k1;}AVLTree *double_rotation_with_left(AVLTree *k3){ k3->left = single_rotation_with_right(k3->left); return single_rotation_with_left(k3);} AVLTree *double_rotation_with_right(AVLTree *k3){ k3->right = single_rotation_with_left(k3->right); return single_rotation_with_right(k3);}void insert(int value, AVLTree **node){ if (*node == NULL) { *node = new AVLTree; if (*node == NULL) { return; } (*node)->element = value; (*node)->height = 0; (*node)->left = (*node)->right = NULL; return; } else if (value < (*node)->element) { insert(value, &((*node)->left)); if (height((*node)->left) - height((*node)->right) == 2) { if (value < (*node)->left->element) { *node = single_rotation_with_left(*node); } else { *node = double_rotation_with_left(*node); } } }

http://worldatyou.blogspot.com/

Page 13: Complete Oracle Paper

http://worldatyou.blogspot.com/

else if (value > (*node)->element) { insert(value, &((*node)->right)); if (height((*node)->right) - height((*node)->left) == 2) { if (value > (*node)->right->element) { *node = single_rotation_with_right(*node); } else { *node = double_rotation_with_right(*node); } } }

(*node)->height = MAX(height((*node)->left), height((*node)->right)) + 1;}

Consider an input sequence that is provided as an input to the insert method20,5,15,9,13,2,6,12,14,15,16,17,18,19

How many times method single_rotation_with_left is called while inserting 18

1

0

2

None of these

Question Number 9

Given the following code snippet answer the following question.

struct AVLTree{ AVLTree * left; AVLTree * right; int element; int height;};int MAX(int a, int b){ if(a>=b) return a; if(a<b) return b;

http://worldatyou.blogspot.com/

Page 14: Complete Oracle Paper

http://worldatyou.blogspot.com/

}int height(AVLTree *node){ if (node == NULL) { return -1; } else { return node->height; }}AVLTree * single_rotation_with_left(AVLTree *k2){ AVLTree *k1; k1 = k2->left; k2->left = k1->right; k1->right = k2; k2->height = MAX(height(k2->left), height(k2->right)) + 1; k1->height = MAX(height(k1->left), height(k2->right)) + 1; return k1;}

AVLTree * single_rotation_with_right(AVLTree *k2){ AVLTree *k1; k1 = k2->right; k2->right = k1->left; k1->left = k2; k2->height = MAX(height(k2->left), height(k2->right)) + 1; k1->height = MAX(height(k1->right), height(k2->left)) + 1; return k1;}AVLTree *double_rotation_with_left(AVLTree *k3){ k3->left = single_rotation_with_right(k3->left); return single_rotation_with_left(k3);} AVLTree *double_rotation_with_right(AVLTree *k3){ k3->right = single_rotation_with_left(k3->right); return single_rotation_with_right(k3);}void insert(int value, AVLTree **node){ if (*node == NULL) { *node = new AVLTree; if (*node == NULL) { return; } (*node)->element = value; (*node)->height = 0; (*node)->left = (*node)->right = NULL; return;

http://worldatyou.blogspot.com/

Page 15: Complete Oracle Paper

http://worldatyou.blogspot.com/

} else if (value < (*node)->element) { insert(value, &((*node)->left)); if (height((*node)->left) - height((*node)->right) == 2) { if (value < (*node)->left->element) { *node = single_rotation_with_left(*node); } else { *node = double_rotation_with_left(*node); } } } else if (value > (*node)->element) { insert(value, &((*node)->right)); if (height((*node)->right) - height((*node)->left) == 2) { if (value > (*node)->right->element) { *node = single_rotation_with_right(*node); } else { *node = double_rotation_with_right(*node); } } }

(*node)->height = MAX(height((*node)->left), height((*node)->right)) + 1;}

Consider an input sequence that is provided as an input to the insert method20,5,15,9,13,2,6,12,14,15,16,17,18,19

Which one of the following would be the root node after inserting 16.

16

17

15

9

http://worldatyou.blogspot.com/

Page 16: Complete Oracle Paper

http://worldatyou.blogspot.com/

Question Number 10

Given the following code snippet answer the following question.

struct AVLTree{ AVLTree * left; AVLTree * right; int element; int height;};int MAX(int a, int b){ if(a>=b) return a; if(a<b) return b;}int height(AVLTree *node){ if (node == NULL) { return -1; } else { return node->height; }}AVLTree * single_rotation_with_left(AVLTree *k2){ AVLTree *k1; k1 = k2->left; k2->left = k1->right; k1->right = k2; k2->height = MAX(height(k2->left), height(k2->right)) + 1; k1->height = MAX(height(k1->left), height(k2->right)) + 1; return k1;}

AVLTree * single_rotation_with_right(AVLTree *k2){ AVLTree *k1; k1 = k2->right; k2->right = k1->left; k1->left = k2; k2->height = MAX(height(k2->left), height(k2->right)) + 1; k1->height = MAX(height(k1->right), height(k2->left)) + 1; return k1;}AVLTree *double_rotation_with_left(AVLTree *k3){ k3->left = single_rotation_with_right(k3->left); return single_rotation_with_left(k3);}

http://worldatyou.blogspot.com/

Page 17: Complete Oracle Paper

http://worldatyou.blogspot.com/

AVLTree *double_rotation_with_right(AVLTree *k3){ k3->right = single_rotation_with_left(k3->right); return single_rotation_with_right(k3);}void insert(int value, AVLTree **node){ if (*node == NULL) { *node = new AVLTree; if (*node == NULL) { return; } (*node)->element = value; (*node)->height = 0; (*node)->left = (*node)->right = NULL; return; } else if (value < (*node)->element) { insert(value, &((*node)->left)); if (height((*node)->left) - height((*node)->right) == 2) { if (value < (*node)->left->element) { *node = single_rotation_with_left(*node); } else { *node = double_rotation_with_left(*node); } } } else if (value > (*node)->element) { insert(value, &((*node)->right)); if (height((*node)->right) - height((*node)->left) == 2) { if (value > (*node)->right->element) { *node = single_rotation_with_right(*node); } else { *node = double_rotation_with_right(*node); } } }

(*node)->height = MAX(height((*node)->left), height((*node)->right)) + 1;}

Consider an input sequence that is provided as an input to the insert method20,5,15,9,13,2,6,12,14,15,16,17,18,19

http://worldatyou.blogspot.com/

Page 18: Complete Oracle Paper

http://worldatyou.blogspot.com/

In the process of inserting the above nodes how many times double_rotation_with_left is being called?

5

0

3

2

Coding Skills (Advanced)

Question Number 1

The subject of these questions is an unusually simple kind of binary tree, defined by these properties:

Terminal nodes contain a string. Internal nodes have one or two children, called "left" and "right".

Either child of an internal node may be null, but not both.

Internal nodes contain no other information.

By "tree" we simply mean a node and all of its descendants.

A tree rooted at a node having left child A and right child B is a different tree than one rooted at a node having left child B and right child A.

Here's an example, with plus signs (+) used to indicate internal nodes:

+ / \ / \ / \ + + / / \ / / \ / / \ "A" + "D" / \ / \ / \ "B" "C"

Which expression would create a representation of the following tree?

IN0 / \ / \

http://worldatyou.blogspot.com/

Page 19: Complete Oracle Paper

http://worldatyou.blogspot.com/

/ \ IN1 IN2 / / \ / / \ / / \ "A" "D" IN3 / \ / \ / \ "B" "C"

InternalNode tree = new InternalNode( new InternalNode(new TerminalNode("A"), null), new InternalNode(new TerminalNode("D"), new InternalNode( new TerminalNode("B"), new TerminalNode("C"))));InternalNode tree = new InternalNode( new InternalNode(new TerminalNode("D"), new InternalNode( new TerminalNode("B"), new TerminalNode("C"))), new TerminalNode("A"))InternalNode tree = new InternalNode( new InternalNode(new TerminalNode("A")), new InternalNode(new TerminalNode("D"), new InternalNode( new TerminalNode("B"), new TerminalNode("C"))));InternalNode tree = new InternalNode( new InternalNode(new TerminalNode("A", null), null), new InternalNode(new TerminalNode("D", null), new InternalNode( new TerminalNode("B", null), new TerminalNode("C", null))));

Question Number 2

The subject of these questions is an unusually simple kind of binary tree, defined by these properties:

Terminal nodes contain a string. Internal nodes have one or two children, called "left" and "right".

Either child of an internal node may be null, but not both.

http://worldatyou.blogspot.com/

Page 20: Complete Oracle Paper

http://worldatyou.blogspot.com/

Internal nodes contain no other information.

By "tree" we simply mean a node and all of its descendants.

A tree rooted at a node having left child A and right child B is a different tree than one rooted at a node having left child B and right child A.

Here's an example, with plus signs (+) used to indicate internal nodes:

+ / \ / \ / \ + + / / \ / / \ / / \ "A" + "D" / \ / \ / \ "B" "C"

Having created a pathTo(String) method we’d like to have the reverse operation, atPath(List). Here is a proposed implementation. (Note that it returns a Node, not a String.)

abstract class Node { abstract bool isTerminal(); abstract Node atPath(List lst);}

class TerminalNode extends Node { boolean isTerminal { return True; } Node atPath(List lst) { if (lst.isEmpty()) return this; return null; }}

class InternalNode extends Node { boolean isTerminal { return False; } Node atPath(List lst) { Node curnode = this; InternalNode ind = null; for (int n = 0; n < lst.size(); n++) { if (curnode.isTerminal()) return null; String dir = lst.get(n); if (!dir.equals("L") && !dir.equals("R")) return null; ind = (InternalNode) curnode; if (dir.equals("L")) curnode = ind.getLeft();

http://worldatyou.blogspot.com/

Page 21: Complete Oracle Paper

http://worldatyou.blogspot.com/

else curnode = ind.getRight(); } return curnode; }}

Which of the possible conditions does the code handle correctly?

A. An empty subtree is encountered before the end of the path.

B. The path leads to a TerminalNode.

C. The path leads to an InternalNode.

All of them.

A but neither B nor C.

A and B but not C

B and C but not A.

Question Number 3

The subject of these questions is an unusually simple kind of binary tree, defined by these properties:

Terminal nodes contain a string. Internal nodes have one or two children, called "left" and "right".

Either child of an internal node may be null, but not both.

Internal nodes contain no other information.

By "tree" we simply mean a node and all of its descendants.

A tree rooted at a node having left child A and right child B is a different tree than one rooted at a node having left child B and right child A.

Here's an example, with plus signs (+) used to indicate internal nodes:

+ / \ / \ / \ + +

http://worldatyou.blogspot.com/

Page 22: Complete Oracle Paper

http://worldatyou.blogspot.com/

/ / \ / / \ / / \ "A" + "D" / \ / \ / \ "B" "C"

We want to locate the first occurrence of a string in the tree and return a “path” that shows how to navigate to it from the root. The path will be represented as a list of strings, with “L” indicating that the left child should be followed and “R” that the right child should be followed. The list “L”, “R” would identify the right child of the left child of the root of the tree.

Assume there is a List data structure available that provides a constructor for creating an empty List addLast(String) to add a string to the end of the list returning the

(modified) list so that, for example, a series of additions could be chained—for example:

lst.addLast("a").addLast("b") Similarly, addFirst(String) adds to the front of the list and returns

the modified list.

Given an abstract definition in Node:

abstract pathTo(String str);and the definition in TerminalNode:

List pathTo(String str) { if (value.equals(str)) return new List(); else return null; }

Which of the following definitions will work correctly to produce the path as described above (or null if the string was not found in the tree)?

List pathTo(String str) { List lst = null; if ((left != null) && (null != (lst = left.pathTo(str)))) return lst.addFirst("L"); if ((right != null) && (null != (lst = right.pathTo(str)))) return lst.addFirst("R"); return null;}List pathTo(String str) { List lst = null; if (left != null) return left.pathTo(str).addFirst("L"); if (right != null) return right.pathTo(str)).addFirst("R");

http://worldatyou.blogspot.com/

Page 23: Complete Oracle Paper

http://worldatyou.blogspot.com/

return null;}List pathTo(String str) { List lst = new List(); if ((left != null) && (null != (lst = left.pathTo(str)))) return lst.addFirst("L"); if ((right != null) && (null != (lst = right.pathTo(str)))) return lst.addFirst("R"); return lst;}List pathTo(String str) { List lst = null; if ((left != null) && (null != (lst = left.pathTo(str)))) return lst.addLast("L"); if ((right != null) && (null != (lst = right.pathTo(str)))) return lst.addLast("R"); return null;}

Question Number 4

The subject of these questions is an unusually simple kind of binary tree, defined by these properties:

Terminal nodes contain a string. Internal nodes have one or two children, called "left" and "right".

Either child of an internal node may be null, but not both.

Internal nodes contain no other information.

By "tree" we simply mean a node and all of its descendants.

A tree rooted at a node having left child A and right child B is a different tree than one rooted at a node having left child B and right child A.

Here's an example, with plus signs (+) used to indicate internal nodes:

+ / \ / \ / \ + + / / \ / / \ / / \ "A" + "D" / \ / \

http://worldatyou.blogspot.com/

Page 24: Complete Oracle Paper

http://worldatyou.blogspot.com/

/ \ "B" "C"

One problem with the proposed implementation of equals is that two nodes of different types cannot be equal. In the following code which of TerminalNode.equals and InternalNode.equals correct this problem assuming the argument to each method is not null? (The relevant parts of the class definitions are included.)

abstract class Node { abstract boolean isTerminal(); abstract boolean equals(Node);}

class TerminalNode { boolean isTerminal() { return true; } boolean equals(Node nd) { return nd.isTerminal() && value.equals(nd.getValue()); }}

class InternalNode { boolean isTerminal() { return false; } boolean equals(Node nd) { return !nd.isTerminal() && left.equals(nd.getLeft()) && right.equals(nd.getRight()); }}

Neither TerminalNode nor InternalNode

TerminalNode but not InternalNode

InternalNode but not TerminalNode

Both TerminalNode and InternalNode

Question Number 5

The subject of these questions is an unusually simple kind of binary tree, defined by these properties:

Terminal nodes contain a string. Internal nodes have one or two children, called "left" and "right".

Either child of an internal node may be null, but not both.

http://worldatyou.blogspot.com/

Page 25: Complete Oracle Paper

http://worldatyou.blogspot.com/

Internal nodes contain no other information.

By "tree" we simply mean a node and all of its descendants.

A tree rooted at a node having left child A and right child B is a different tree than one rooted at a node having left child B and right child A.

Here's an example, with plus signs (+) used to indicate internal nodes:

+ / \ / \ / \ + + / / \ / / \ / / \ "A" + "D" / \ / \ / \ "B" "C"

Here is a proposed implementation of equals for the tree structure:

abstract class Node { abstract boolean equals(Node nd);}

class TerminalNode { boolean equals(Node nd) { return value.equals(nd.getValue()); }}

class InternalNode { boolean equals(Node nd) { return left.equals(nd.getLeft()) && right.equals(nd.getRight()); }}

Which classes contain correctly implemented methods?A. TerminalNode

B. InternalNode

Neither

A

http://worldatyou.blogspot.com/

Page 26: Complete Oracle Paper

http://worldatyou.blogspot.com/

B

Both

Question Number 6

The subject of these questions is an unusually simple kind of binary tree, defined by these properties:

Terminal nodes contain a string. Internal nodes have one or two children, called "left" and "right".

Either child of an internal node may be null, but not both.

Internal nodes contain no other information.

By "tree" we simply mean a node and all of its descendants.

A tree rooted at a node having left child A and right child B is a different tree than one rooted at a node having left child B and right child A.

Here's an example, with plus signs (+) used to indicate internal nodes:

+ / \ / \ / \ + + / / \ / / \ / / \ "A" + "D" / \ / \ / \ "B" "C"

The problem with the previous definition of InternalNode.equals is that it calls nd.getLeft() and nd.getRight(), but only InternalNode defines those methods and nd could be a TerminalNode. The following code fixes that and will compile.

abstract class Node { abstract boolean isTerminal(); abstract boolean equals(Node);}

class TerminalNode { boolean isTerminal() { return true; }

http://worldatyou.blogspot.com/

Page 27: Complete Oracle Paper

http://worldatyou.blogspot.com/

boolean equals(Node nd) { return nd.isTerminal() && value.equals(nd.getValue()); }}

class InternalNode { boolean isTerminal() { return false; } boolean equals(Node nd) { return !nd.isTerminal() && left.equals(((InternalNode)nd).getLeft()) && right.equals(((InternalNode)nd).getRight()); }}

This version of the code does not check for null in either TerminalNode or InternalNode. If equals is called on an InternalNode with a non-null argument, which of the two methods could end up getting called with a null argument for certain trees?

Both methods could ever be called with a null argument with certain trees.

TerminalNode.equals Both methods could be called with a null argument with certain trees but not InternalNode.InternalNode.equals Both methods could be called with a null argument with certain trees but not TerminalNode.

Neither method could ever be called with a null argument with certain trees.

Question Number 7

The subject of these questions is an unusually simple kind of binary tree, defined by these properties:

Terminal nodes contain a string. Internal nodes have one or two children, called "left" and "right".

Either child of an internal node may be null, but not both.

Internal nodes contain no other information.

By "tree" we simply mean a node and all of its descendants.

A tree rooted at a node having left child A and right child B is a different tree than one rooted at a node having left child B and right child A.

Here's an example, with plus signs (+) used to indicate internal nodes:

+

http://worldatyou.blogspot.com/

Page 28: Complete Oracle Paper

http://worldatyou.blogspot.com/

/ \ / \ / \ + + / / \ / / \ / / \ "A" + "D" / \ / \ / \ "B" "C"

It is proposed to add a check for null at the beginning of each method, returning False if the argument is null, since a Node object would never be equal to null. This change is shown in the code below. In which method(s) could null’s other than the argument be a problem?

abstract class Node { abstract boolean isTerminal(); abstract boolean equals(Node);}

class TerminalNode { boolean isTerminal() { return true; } boolean equals(Node nd) { return nd != null && nd.isTerminal() && value.equals(nd.getValue()); }}

class InternalNode { boolean isTerminal() { return false; } boolean equals(Node nd) { return nd != null && !nd.isTerminal() && left.equals(nd.getLeft()) && right.equals(nd.getRight()); }}

Neither TerminalNode.equals nor InternalNode.equals – they are both correct as is.

TerminalNode.equals needs further code to deal with nulls but InternalNode.equals doesn’t.InternalNode.equals needs further code to deal with nulls but TerminalNode.equals doesn’t.Both TerminalNode.equals and InternalNode.equals need further code to deal with nulls.

http://worldatyou.blogspot.com/

Page 29: Complete Oracle Paper

http://worldatyou.blogspot.com/

Question Number 8

The subject of these questions is an unusually simple kind of binary tree, defined by these properties:

Terminal nodes contain a string. Internal nodes have one or two children, called "left" and "right".

Either child of an internal node may be null, but not both.

Internal nodes contain no other information.

By "tree" we simply mean a node and all of its descendants.

A tree rooted at a node having left child A and right child B is a different tree than one rooted at a node having left child B and right child A.

Here's an example, with plus signs (+) used to indicate internal nodes:

+ / \ / \ / \ + + / / \ / / \ / / \ "A" + "D" / \ / \ / \ "B" "C"

We want to define an operation to get the list element at position N (with the first element is at position 0). Which statements are correct in the following implementation?

class SinglyLinkedList { InternalNode first;

String nth(int n) { InternalNode nd = first; while (n-- > 0) nd = nd.getRight(); return ((TerminalNode)(nd.getLeft())).getValue(); }}

The while statement (both the condition and the action) is correct.

The return statement (taking into account all the details of the entire statement).

There are problems with both the while and return statements.

Both the while and return statements are correct.

http://worldatyou.blogspot.com/

Page 30: Complete Oracle Paper

http://worldatyou.blogspot.com/

Question Number 9

The subject of these questions is an unusually simple kind of binary tree, defined by these properties:

Terminal nodes contain a string. Internal nodes have one or two children, called "left" and "right".

Either child of an internal node may be null, but not both.

Internal nodes contain no other information.

By "tree" we simply mean a node and all of its descendants.

A tree rooted at a node having left child A and right child B is a different tree than one rooted at a node having left child B and right child A.

Here's an example, with plus signs (+) used to indicate internal nodes:

+ / \ / \ / \ + + / / \ / / \ / / \ "A" + "D" / \ / \ / \ "B" "C"

We want to define an operation to get the list element at position N (with the first element is at position 0). Which statements are correct in the following implementation, which differs slightly from the previous version?

class SinglyLinkedList { InternalNode first;

String nth(int n) { InternalNode nd = first; while (n-- > 0 && nd != null) nd = nd.getRight(); return (null == nd) ? null : ((TerminalNode)(nd.getLeft())).getValue(); }}

The while statement (both the condition and the action) is correct.

The return statement (taking into account all the details of the entire statement).

http://worldatyou.blogspot.com/

Page 31: Complete Oracle Paper

http://worldatyou.blogspot.com/

There are problems with both the while and return statements.

Both the while and return statements are correct.

Question Number 10

The subject of these questions is an unusually simple kind of binary tree, defined by these properties:

Terminal nodes contain a string. Internal nodes have one or two children, called "left" and "right".

Either child of an internal node may be null, but not both.

Internal nodes contain no other information.

By "tree" we simply mean a node and all of its descendants.

A tree rooted at a node having left child A and right child B is a different tree than one rooted at a node having left child B and right child A.

Here's an example, with plus signs (+) used to indicate internal nodes:

+ / \ / \ / \ + + / / \ / / \ / / \ "A" + "D" / \ / \ / \ "B" "C"

Would the following be an adequate implement of an operation to insert a string at the front of the list?

void insert(String str) { first = new InternalNode(new TerminalNode(str), first);}

No, it is not always necessary to create a new TerminalNode.

No, it is not always necessary to create a new InternalNode.

There circumstances in which executing this method will violate the restrictions imposed on the tree by the general specifications and the specific specifications for its use as a list.

It is a valid implementation under all conditions.

http://worldatyou.blogspot.com/

Page 32: Complete Oracle Paper

http://worldatyou.blogspot.com/

http://worldatyou.blogspot.com/

Page 33: Complete Oracle Paper

http://worldatyou.blogspot.com/

Computer Science Knowledge (Basic)

Question Number 1

A program uses a queue to visit each of the nodes of a binary tree, starting at its root. After a node is processed its children are added to the the end of the queue. In what order do nodes get processed?

Inorder

Postorder

Breadth-first

Preorder

Question Number 2

What features must a programming language and its runtime environment provide in order to support automatic memory management?

1. Dynamic memory allocation2. Explicit deallocation of data3. Garbage collection

1 and 3, but not 2

3

2

1

Question Number 3

From the following options, select a statement that is NOT true about symbol tables.

http://worldatyou.blogspot.com/

Page 34: Complete Oracle Paper

http://worldatyou.blogspot.com/

Symbol tables are often implemented using hash tables

Symbol tables map the names to their attributes

Symbol table is a compile-time data structure

Symbol table is used during syntactic analysis

Question Number 4

Consider an application that requires inserting and deleting data items in a data structure dynamically.

From the following options, select an appropriate data structure for this scenario.

Stack

Array

Queue

Linked List

Question Number 5

Which one of the following is NOT a phase of program compilation?

Code generation

Parsing

Macro expansion

Lexical analysis

Question Number 6

Consider the following scenarios.

- An operating system having a list of processes that are waiting to get access of the CPU. - A list of jobs waiting to access the printer for printing.

From the following options, select the ideal data structure that can be used in these scenarios.

Array

http://worldatyou.blogspot.com/

Page 35: Complete Oracle Paper

http://worldatyou.blogspot.com/

Linked list

Queue

Stack

Question Number 7

Select the decimal value of arithmetic shift right by 2 operation on a signed integer -102.

+57

-39

+39

-57

Question Number 1

From the following options, select the OOP mechanism, that allows treatment of the derived class members just like the members of their parent class.

Encapsulation

Polymorphism

Abstraction

Decoupling

Question Number 2

Select the option that describes a "type" in Object Oriented programming.

It indicates the state that an object maintains

It describes how an object implements the methods in its interface

It defines implementation of an object

It is an interface, which is a collection of methods that an object responds to

http://worldatyou.blogspot.com/

Page 36: Complete Oracle Paper

http://worldatyou.blogspot.com/

Question Number 3

Select the sorting that always has a time complexity O(n2), irrespective of the condition of the array.

Quick Sort

Merge sort

Selection sort

Bubble sort

Question Number 4

Select the OOP concept described by the following features.

A. Defines the abstract characteristics of a thing (object). B. Defines attributes of the thing. C. Defines the behavior of the thing. D. Represents a blueprint describing the nature of the thing.

Class

Function

Method

Instance

Question Number 5

Select the option that shows the correct matching between the function types and the Big O descriptions.

I Constant 1 O(log n)

II Logarithmic 2 O(1)

III Linear 3 O(n)

IV Quadratic 4 O(n3)

V Cubic 5 O(2n)

VI Exponential 6 O(n2)

http://worldatyou.blogspot.com/

Page 37: Complete Oracle Paper

http://worldatyou.blogspot.com/

(I,2),(II,1),(III,3),(IV,6),(V,4),(VI,5)

(I,3),(II,5),(III,4),(IV,6),(V,2),(VI,I)

(I,5),(II,6),(III,2),(IV,1),(V,4),(VI,3)

(I,1),(II,2),(III,3),(IV,4),(V,5),(VI,6)

Question Number 6

Select the option that denotes, "runtime is proportional to five times the input size".

O(n5)

5O(n)

O(5n)

5*O(n)

Question Number 1

Which one of the following is NOT a referential integrity issue in a relational database where the DEPT column of the EMPLOYEE table is designated as a foreign key into the DEPARTMENT table?

Inserting a new row into EMPLOYEE with a DEPT whose value is not the primary key of any of the rows in DEPARTMENT

Deleting a row of DEPARTMENT

Inserting a new row into DEPARTMENT with a primary key that is not the value of the DEPT column of any row in EMPLOYEEUpdating the value of DEPT in a row of EMPLOYEE with a value that is not the primary key of any of the rows in DEPARTMENT

Question Number 2

ABC Housekeeping Forces are responsible for maintaining a building that comprises of 100 floors. The maintenance company decides to use a database to schedule work for its employees and also check the status of the work. When an assigned housekeeper does NOT report for work, an alternate resource is allotted to complete the job.

The Housekeeping database in its current form is given below.

http://worldatyou.blogspot.com/

Page 38: Complete Oracle Paper

http://worldatyou.blogspot.com/

HousekeeperHouseKeeperIDHouseKeeperNameHouseKeeperSSNSupervisorID

SupervisorSupervisorIDSupervisorNameSupervisorSSN

FloorFloorNoFloorName

TransactionFloorNoDutyDateHouseKeeperIDWorkStatus

AlternateTransactionFloorNoDutyDateAlternateHIDAlternateWorkSt

Select the option that correctly lists the foreign keys for the different entities. Note that the entity names are given in bold.

Housekeeper – SupervisorID Supervisor – HousekeeperIDTransaction – HousekeeperIDAlternateTransaction – AlternateHIDHousekeeper – HousekeeperSSNSupervisor – SupervisorSSN Transaction – HousekeeperIDAlternateTransaction – AlternateHIDHousekeeper – SupervisorID Transaction – HousekeeperIDAlternateTransaction – AlternateHIDHousekeeper – HousekeeperID Supervisor – SupervisorID Floor – FloorNo or FloorNameTransaction – FloorNoAlternateTransaction – FloorNo

http://worldatyou.blogspot.com/

Page 39: Complete Oracle Paper

http://worldatyou.blogspot.com/

Question Number 3

Select the option that correctly describes the database replication concept where two or more replicas synchronize each other through a transaction identifier.

Quorum

Multimasterslave

Master-Slave

Multimaster

Question Number 4

You have two relation variables: RelV1 and RelV2. They are NOT necessarily distinct. You have a set K as a key for RelV1. Consider that FK is a subset of the heading of RelV2 that involves exactly the same attributes as K.  

From the following options, select the option that correctly depicts a scenario where FK can be considered as a foreign key.

Every tuple in RelV1 has a K value that is equal to the FK value in some tuple in RelV2

Every tuple in RelV1 has a FK value that is equal to the K value in some tuple in RelV2

Every tuple in RelV2 has a K value that is equal to the FK value in some tuple in RelV1

Every tuple in RelV2 has a FK value that is equal to the K value in some tuple in RelV1

Question Number 5

Select the option that represents the ‘I’ in ACID rules.

Either all the statements in a transaction must be executed, or none of them should be executed

Any two simultaneous transactions cannot obstruct each other

The completed transactions cannot be aborted later

Each transaction must maintain the integrity constraints of the database

http://worldatyou.blogspot.com/

Page 40: Complete Oracle Paper

http://worldatyou.blogspot.com/

ABC Housekeeping Forces are responsible for maintaining a building that comprises of 100 floors. The maintenance company decides to use a database to schedule work for its employees and also check the status of the work. When an assigned housekeeper does NOT report for work, an alternate resource is allotted to complete the job.

The Housekeeping database in its current form is given below.

HousekeeperHouseKeeperIDHouseKeeperNameHouseKeeperSSNSupervisorID

SupervisorSupervisorIDSupervisorNameSupervisorSSN

FloorFloorNoFloorName

TransactionFloorNoDutyDateHouseKeeperIDWorkStatus

AlternateTransactionFloorNoDutyDateAlternateHIDAlternateWorkSt

Select the option that correctly lists the single field primary keys for the various entities. Note that the entity names are given in bold.

Housekeeper – HousekeeperIDSupervisor – SupervisorIDTransaction – FloorNoAlternateTransaction – FloorNoHousekeeper – HousekeeperIDSupervisor – SupervisorIDFloor – FloorNoTransaction – FloorNoAlternateTransaction – FloorNo

http://worldatyou.blogspot.com/

Page 41: Complete Oracle Paper

http://worldatyou.blogspot.com/

Housekeeper – HousekeeperIDSupervisor – SupervisorIDFloor – FloorNoTransaction – FloorNoAlternateTransaction – AlternateHIDHousekeeper – HousekeeperIDSupervisor – SupervisorIDFloor – FloorNo

Question Number 7

Select the option that represents the definition of network database model.

Represents the entire information content of the database in only one way

Organizes the data in the form of a tree of records, with each record having one parent record and many children recordsAllows each record to have multiple parent and child records, thereby forming a lattice structureAttempts to bring closer interactivity between database administrators and application programmers

http://worldatyou.blogspot.com/

Page 42: Complete Oracle Paper

http://worldatyou.blogspot.com/

http://worldatyou.blogspot.com/

Page 43: Complete Oracle Paper

http://worldatyou.blogspot.com/

Software Engineering AptitudeSupport ID: 14D760B

Question Number 1

A number when divided by 161 leaves a remainder of 57. Find the remainder if the same number is divided by 7?

1

2

5

4

Question Number 2

A car travels x km at 60 km/hr and another 3x km at 90 km/hr. Find its average over the entire distance?

80 km/hr

72 km/hr

84 km/hr

75 klm/hr

Question Number 3

Provisions are available for a battalion of 2000 soldiers for 35 weeks at the rate of 16 kgs per day per person. If some more soldiers join the battalion, the provisions would last for 20 weeks at the rate of 20 kgs per day per person. Find the number of soldiers joining the battalion?

200

800

1000

http://worldatyou.blogspot.com/

Page 44: Complete Oracle Paper

http://worldatyou.blogspot.com/

400

Question Number 4

In an organization, if there 24 more executives, then the number of executives will be three times the number of managers. If there are two more managers, then the number of executives will be twice the number of managers. What is the number of executives?

60

48

36

72

Question Number 5

The price of sugar is increased by 12% and the consumption is decreased by 8%. The net change in the expenditure on this account is __________.

3.04% increase

3.04% decrease

4 % increase

2.64 % decrease

Question Number 6

Find the probability that a number selected at random from the first 25 natural numbers is divisible by 2 or 5?

2/5

3/5

1/6

17/25

http://worldatyou.blogspot.com/

Page 45: Complete Oracle Paper

http://worldatyou.blogspot.com/

Question Number 7

A man rows downstream and covers 15 km in 3 hours. He covers the same distance upstream in 5 hours. What is the difference in the distance traveled upstream in six hours and that traveled downstream in six hours?

12 km

6 km

4 km

2 km

Question Number 8

Two pipes A and B can fill a tank in 6 hours and 4 hours respectively. If A is opened first, and the pipes are opened alternately for one hour each, in how many hours will the tank be full?

4 h

5 h

5.5 h

4.5 h

A sum of US $ 30000 is invested is a bank at 12% interest p.a. compounded semi-annually. After one and half year it will amount to __________.

US $ 36620.10

US $ 36120.30

US $ 35320.20

US $ 35730.48

Question Number 10

A is directly proportional to B when C is constant and inversely proportional to the square of C when B is constant. In a particular instance when A = 18, B = 25 and C = 10, find A if C = 9 and B = 18.

http://worldatyou.blogspot.com/

Page 46: Complete Oracle Paper

http://worldatyou.blogspot.com/

24

12

16

32

Question Number 1

The speed of a boat in still water is S. The speed of the current is C. Which of the following expressions best represents the total time taken by the boat to cover a distance D between two points named A and B, both ways, that is with and against the current?

D/2S

2D/S

D/(S+C) + D/(S-C)

(A-B)/(S+C) + (B-A)/(S-C)

At a salad bar, the cost of a meal is a fixed amount of $X, plus $Y per item selected from a menu of extra items. Six friends eat at the salad bar, selecting 17 extra items. Only four of them pay the entire bill by splitting it equally. The amount to be paid by each person paying the bill is __________.

X + Y

(6X + 17Y) / 4

(6X+6Y) / 4

(6X + 17Y) / 6

Question Number 3

The problem below contains a question and two statements labeled A and B that give data pertaining to the question. Determine whether the information given in statements A and B is sufficient to answer the question, and select the correct answer from the given options.

What is Stan’s age?

http://worldatyou.blogspot.com/

Page 47: Complete Oracle Paper

http://worldatyou.blogspot.com/

A. Stan’s age in 12 years will be twice what it was 8 years ago

B. Stan’s son was born four years ago and will be half Stan’s age in 20 years.

The question can be answered by using one of the statements alone but not the other

The question can be answered by using either statement alone

The question can be answered by using both the statements together, but not by using either statement aloneNeither of the statements, individually or jointly, provides sufficient data to answer the question

N mules carry loads averaging X kilograms (kgs) each. M mules are added to the group, and the average weight carried by the expanded group goes up by Y%. What is the average weight in kgs carried by the added mules?

( X*(1+0.01Y)(N-M) – MX ) / M

( X*(1+0.01Y)(N-M) – NX ) / M

( X*(1+0.01Y)(N+M) – MX ) / M

( X*(1+0.01Y)(N+M) – NX ) / M

Question Number 5

The problem below contains a question and two statements labeled A and B that give data pertaining to the question. Determine whether the information given in statements A and B is sufficient to answer the question, and select the correct answer from options 1-4.

1. The question can be answered by using one of the statements alone but not the other.

2. The question can be answered by using either statement alone.

3. The question can be answered by using both the statements together, but not by using either statement alone.

4. Neither of the statements, individually or jointly, provides sufficient data to answer the question.

Pipes X, Y and Z flow at different rates and together take 24/13 minutes to fill a bucket. What is the time taken by Y and Z together to fill the bucket?

http://worldatyou.blogspot.com/

Page 48: Complete Oracle Paper

http://worldatyou.blogspot.com/

A. The time taken by X & Y is 12/5 minutes

B. The time taken by X & Z is 8/3 minutes

1

2

3

4

Question Number 6

An airline assumes that on average each passenger weighs x pounds. It also assumes that 80% of passengers will have luggage which on average weighs y pounds. In addition to passengers, each airplane carries freight and the airline assumes that each container weighs z pounds. How would you calculate the expected weight of a plane scheduled to carry P passengers and F containers of freight.

0.8Px + Py + Fz

0.8(Px + Py) + Fz

P(x + .8y)Fz

P(x + .8y) + Fz

Question Number 7

The problem below contains a question and two statements labeled A and B that give data pertaining to the question. Determine whether the information given in statements A and B is sufficient to answer the question, and select the correct answer from options 1-4:

1. The question can be answered by using one of the statements alone but not the other.

2. The question can be answered by using either statement alone.

3. The question can be answered by using both the statements together.

4. Neither of the statements, individually or jointly, provide sufficient data to answer the question.

20 men take 3 hours to build a wall. How long does it take for 15 women to build the wall?

http://worldatyou.blogspot.com/

Page 49: Complete Oracle Paper

http://worldatyou.blogspot.com/

A. A woman works at half the pace of a manB. 5 men and 10 women can build the wall in 6 hours

1

2

3

4

Question Number 8

An article is sold after giving discounts of D1% and D2% on the marked price $MRP. What is the profit percentage earned by the article on its cost price $CP?

100*( (1 – 0.01D1) (1-0.01D2) * CP – MRP ) / CP

100 * ( (1 – 0.01D1) (1 – 0.01D2) * CP – MRP ) / MRP

100 * ( (1 – 0.01D1) (1 – 0.01D2) * MRP – CP ) / CP

100 * ( (1 – 0.01D1) (1 – 0.01D2) * MRP – CP ) / MRP

Question Number 9

The problem below contains a question and two statements labeled A and B that give data pertaining to the question. Determine whether the information given in statements A and B is sufficient to answer the question, and select the correct answer from options 1-4.

1. The question can be answered by using one of the statements alone but not the other.

2. The question can be answered by using either statement alone.

3. The question can be answered by using both the statements together.

4. Neither of the statements, individually or jointly, provides sufficient data to answer the question.

Is the average speed of a cheetah more than 70 km/h?

A. The cheetah covered the distance of 3 kms in two minutes

B. In the second minute the cheetah ran at half the speed in the first minute

http://worldatyou.blogspot.com/

Page 50: Complete Oracle Paper

http://worldatyou.blogspot.com/

1

2

3

4

Question Number 10

The problem below contains a question and two statements labeled A and B that give data pertaining to the question. Determine whether the information given in statements A and B is sufficient to answer the question, and select the correct answer from options 1-4.

1. The question can be answered by using one of the statements alone but not the other.

2. The question can be answered by using either statement alone.

3. The question can be answered by using both the statements together.

4. Neither of the statements, individually or jointly, provides sufficient data to answer the question.

In a particular class, each student studies Psychology, Sociology, or both subjects. How many students study only Sociology?

A. 30 students study Psychology and 25 students study Sociology

B. The class has 50 students, and 5 students study both subjects

1

2

3

4

Question Number 1

Based on the data in the following table, answer the question below it.

http://worldatyou.blogspot.com/

Page 51: Complete Oracle Paper

http://worldatyou.blogspot.com/

Which one of the following is the correct combination of Part Number and Part Name in the table?

Arrow Shirt Cotton – sleeves – Red stripes Size-42 & 451-TET-KLVB64-154AA/36

Denim Jeans Gents Blue Size 40 & 231-PLK-SEHT96-236AS/62

Killer Jeans Ladies Stretchable Black Size 34 & 125-LKJ-LKEFT55-111VV/18

Denim Jeans Gents Blue Size 40 & 510-TRT-LDKG21-652PF/23

Question Number 2

Based on the data in the following table, answer the question below it.

http://worldatyou.blogspot.com/

Page 52: Complete Oracle Paper

http://worldatyou.blogspot.com/

The correct credit card details of the customer “Fowler, Heather” are __________.

4532343207436130

4532343204736130

4532343204736310

4532343204763130

Question Number 3

Based on the data in the following table, answer the question below it.

http://worldatyou.blogspot.com/

Page 53: Complete Oracle Paper

http://worldatyou.blogspot.com/

Which one of the following is NOT a correct Customer Detail?

2371 Heritage Road, Fresno, CA 93721 10-07-58

2136 Clinton Street, Philadelphia, PA 19108 04-02-52

2291 Melody Lane, Richmond, VA 23324 12-05-59

119 Ridenour Street, Miramar, FL 33025 12-08-50

Question Number 4

Based on the data in the following table, answer the question below it.

http://worldatyou.blogspot.com/

Page 54: Complete Oracle Paper

http://worldatyou.blogspot.com/

The correct details of the customer “Truelove, James” is __________.

605-882-2787 4/13/1956

605-822-2877 4/13/1956

605-822-2787 4/13/1956

605-822-2787 4/13/1965

uestion Number 1

Please carefully read the following:

The following flowchart computes the sum of the squares of all primes between 1 and N inclusive.

http://worldatyou.blogspot.com/

Page 55: Complete Oracle Paper

http://worldatyou.blogspot.com/

What is the value of Cell 1?

Is X = N?

Is X < N?

Is X > N?

Is X > TEMP?

Question Number 2

Please carefully read the following:

The following flowchart computes the sum of the squares of all primes between 1 and N inclusive.

http://worldatyou.blogspot.com/

Page 56: Complete Oracle Paper

http://worldatyou.blogspot.com/

What is the value of Cell 4?

TEMP = TEMP – 1

TEMP = TEMP + 1

X = X + 1

X = X – 1

Question Number 3

Please carefully read the following:

The following flowchart computes the sum of the squares of all primes between 1 and N inclusive.

http://worldatyou.blogspot.com/

Page 57: Complete Oracle Paper

http://worldatyou.blogspot.com/

What is the value of Cell 5?

X = X – 1

X = X + 1

TEMP = TEMP – 1

TEMP = TEMP + 1

Question Number 4

Please carefully read the following:

The following flowchart computes the sum of the squares of all primes between 1 and N inclusive.

http://worldatyou.blogspot.com/

Page 58: Complete Oracle Paper

http://worldatyou.blogspot.com/

What is the value of Cell 3?

DIV = N / TEMP

DIV = N / X

DIV = TEMP / X

DIV = X / TEMP

Question Number 5

Please carefully read the following:

The following flowchart computes the sum of the squares of all primes between 1 and N inclusive.

http://worldatyou.blogspot.com/

Page 59: Complete Oracle Paper

http://worldatyou.blogspot.com/

What is the value of Cell 2?

TEMP = 0

TEMP = 1

TEMP = 2

TEMP = TEMP + 1

http://worldatyou.blogspot.com/