Thursday 13 September 2012

JUNE 2012 - PAPER II

24. In a function oriented design, we

(A) minimize cohesion and maximize coupling
(B) maximize cohesion and minimize coupling
(C) maximize cohesion and maximize coupling
(D) minimize cohesion and minimize coupling

Ans:-B

Explanation:-
A function oriented design focusses on creating modules or functions and each module supports its own abstraction. The design purpose is to minimize coupling and maximize cohesion. Cohesion is a way of understanding how close or bound your module is. Coupling is the level of interactivity between modules. For a good design to happen cohesion should be more and coupling should be less.


25. Which of the following metric does not depend on the programming language used ?

(A) Line of code
(B) Function count
(C) Member of token
(D) All of the above

Ans:-B

Explanation:-
Line of count and Member of token depend on the programming language. Function count does not depend on programming language. Function count are a unit of measure for software just like a unit of measure for temperature would be degrees.


26. A/B+ tree index is to be built on the name attribute of the relation STUDENT. Assume that all students names are of length 8 bytes, disk block are of size 512 bytes and index pointers are of size 4 bytes. Given this scenario what would be the best choice of the degree (i.e. the number of pointers per node) of the B+ tree ?

(A) 16
(B) 42
(C) 43
(D) 44

Ans:-C

Actually the answer given in the UGC answer key is option A. But i would beg to differ with that. Using the formula for calculating the degree with the parameters specified above, the answer we are arriving at is 43 which is actually option C. Let me explain how it is done.

Let n be the degree.
Given, Key size(length of the name attribute of STUDENT) = 8 bytes(k)
   Index pointer size = 4 bytes (b)
   Disk Block size = 512 bytes
Degree of B+ tree can be calculated if we know the maximum number of key a internal node can have. The formula for that is
(n-1)k+n*b= blocksize
(n-1)*8+n*4=512
8n - 8 + 4n = 512
12n=520
n=520/12=43

So, the answer is option C.


27. The Inorder traversal of the tree will yield a sorted listing of elements of tree in

(A) Binary tree
(B) Binary search tree
(C) Heaps
(D) None of the above

Ans:-B

Explanation:-
In a binary search tree all the elements to the root of the tree will lesser than that of the root. Also elements greater than the root will be to the right of the root. So, in order traversal of such a tree would yield a sorted listing of elements.


28. Mobile IP provides two basic functions.

(A) Route discovery and registration
(B) Agent discovery and registration
(C) IP binding and registration
(D) None of the above

Ans:-B

Explanation:-
Mobile IP is the basic behind how wireless devices offer IP connectivity. Agent discovery and registration are two basic functions involved here. So the options is B.


29. Pre-emptive scheduling is the strategy of temporarily suspending a gunning process

(A) before the CPU time slice expires
(B) to allow starving processes to run
(C) when it requests I/O
(D) to avoid collision

Ans:-A

Explanation:-
Again one of those rare non ambiguous question. Every process is allocated a specific time slice in the CPU and it runs for that entire time. In pre-emptive scheduling even before the process's time slice expires, it is temporarily suspended from its execution. So the option is A.


2 comments:

  1. in question no:27 explanation. it should be like this.
    "In a binary search tree all the elements to the left of the tree will lesser than that of the root"

    ReplyDelete
  2. I agree with you for question 26
    To calculate the order p of a B+ tree, suppose the search field is V = 8
    bytes long, the block size is B = 1024 bytes, and a block pointer is P
    = 2 bytes. As internal node of the B+ tree can have up to p tree
    pointers and p-1 search field values, these must fit into a single
    block. Hence, we have,
    solution:
    • (p * 2) + (( p – 1 ) * 8 <= 1024
    • or (10 * p) <= 1032
    • p = 103
    • We have 103 pointers and 102 search field values

    ReplyDelete