# CS GATE 2015 (Test 4)

Tag: cs gate 2015
Q.1
Consider the intermediate code given below. The number of nodes and edges in the control-flow-graph constructed for the above code, respectively, are
A. 5 and 7
B. 6 and 7
C. 5 and 5
D. 7 and 8
Explaination / Solution:
No Explaination.

Workspace
Report
Q.2
Consider the following routing table at an IP router: For each IP address in Group I identify the correct choice of the next hop from Group II using the entries from the routing table above. A. i - a, ii - c, iii - e, iv - d
B. i - a, ii - d, iii - b, iv - e
C. i - b, ii - c, iii - d, iv - e
D. i - b, ii - c, iii - e, iv - d
Explaination / Solution:
No Explaination.

Workspace
Report
Q.3
Consider two relations R1(A,B) with the tuples (1.5), (3,7) and R2 (A,C) = (1,7), (4,9). Assume that R(A,B,C) is the full natural outer join of R1 and R2 . Consider the following tuples of the form (A,B,C): a = (1.5,null), b = (1,null,7) c = (3,null,9), d = (4,7,null), e = (1,5,7), f = (3,7,null), g = (4,null,9). Which one of the following statements is correct?
A. R contains a,b,e,f,g but not c, d.
B. R contains all of a,b,c,d,e,f,g
C. R contains e,f,g but not a,b
D. R contains e but not f,g.
Explaination / Solution: Workspace
Report
Q.4
A graph is self-complementary if it is isomorphic to its complement For all self-complementary graphs on n vertices, n is
A. A multiple of 4
B. Even
C. Odd
D. Congruent to 0 mod 4, or, 1 mod 4
Explaination / Solution:

An n vertex self complementary graph has exactly half number of edges of the complete graph i.e., n(n-1)/4 edges. Since n(n-1) must be divisible by 4 , n must be congruent to 0 or 1 module 4.

Workspace
Report
Q.5
Consider the basic COCOMO model where E is the effort applied in person-months, D is the development time in chronological months, KLOC is the estimated number of delivered lines of code (in thousands) and ab ,bb , cb ,db have their usual meanings. The basic COCOMO equations are of the form
A. E = ab (KLOC) exp (bb), D = cb (E)exp(db)
B. D = ab (KLOC) exp (bb), E = cb (D)exp(db)
C. E = ab exp (bb), D = cb (KLOC)exp(db)
D. E = ab exp (db), D = cb (KLOC)exp(bb)
Explaination / Solution:
No Explaination.

Workspace
Report
Q.6
A software requirements specification (SRS) document should avoid discussing which one of the following?
A. User interface issues
B. Non-functional requirements
C. Design specification
D. Interfaces with third party software
Explaination / Solution:

SRS is a description of a software system to be developed, laying out functional & nonfunctional requirements and may include a set of use cases that describe interactions the user will have with the software.

Workspace
Report
Q.7
Consider a processor with byte-addressable memory. Assume that all registers, including Program Counter (PC) and Program Status Word (PSW), are of size 2 bytes. A stack in the main memory is implemented from memory location (0100)16 and it grows upward. The stack pointer (SP) points to the top element of the stack. The current value of SP is (016E)16. The CALL instruction is of two words, the first word is the op-code and the second word is the starting address of the subroutine. (oneword = 2bytes). The CALL instruction is implemented as follows:
 Store the current Vale of PC in the Stack
 Store the value of PSW register in the stack
The content of PC just before the fetch of a CALL instruction is (5FA0)16. After execution of the CALL instruction, the value of the stack pointer is
A. (016A)16
B. (016C)16
C. (0170)16
D. (0172)16
Explaination / Solution:
No Explaination.

Workspace
Report
Q.8
Host A sends a UDP datagram containing 8880 bytes of user data to host B over an Ethernet LAN. Ethernet frames may carry data up to 1500 bytes (i.e. MTU = 1500 bytes). Size of UDP header is 8 bytes and size of IP heard is 20 bytes.There is no option field in IP header How many total number of IP fragments will be transmitted and what will be the contents of offset field in the last fragment?
A. 6 and 95
B. 6 and 7400
C. 7 and 1110
D. 7 and 8880
Explaination / Solution: Workspace
Report
Q.9
Consider a function f(x) = 1-|x| on -1≤ x ≤ 1. The value of x at which the function attains a maximum, and the maximum value of the function are.
A. 0,-1
B. -1,0
C. 0,1
D. -1,2
Explaination / Solution: Workspace
Report
Q.10
Four branches of a company are located at M.N.O and P. M is north of N at a distance of 4km: P is south of O at a distance of 2 km: N is southeast of O by 1 km. What is the distance between M and P in km?
A. 5.34
B. 6.74
C. 28.5
D. 45.49 