Question 1

Which of the following problems are decidable?
1)Does a given program ever produce an output?
2)If L is context-free language, then, is L` also context-free?
3)If L is regular language, then, is L` also regular
4)If L is recursive language, then, is L` also recursive?

A : 1,2,3,4
B : 1,2
C : 2,3,4
D : 3,4

•
.

Solution :
CFL’s are not closed under complementation. Regular and recursive languages are closed under complementation.

•   Question 2

Given the language L-{ab, aa, baa}, which of the following strings are in L*?
1) abaabaaabaa
2) aaaabaaaa
3) baaaaabaaaab
4) baaaaabaa

A : 1,2 and 3
B : 2,3 and 4
C : 1,2 and 4
D : 1,3 and 4

•
.

Solution :
L ={ab, aa, baa}
Let S1 = ab , S2 = aa and S3 =baa
abaabaaabaa can be written as S1S2S3S1S2 aaaabaaaa can be written as S1S1S3S1 baaaaabaa can be written as S3S2S1S2

•   Question 3

In the IPv4 addressing format, the number of networks allowed under Class C addresses is

A : 2^14
B : 2^7
C : 2^21
D : 2^24

•
.

Solution :
For class C address, size of network field is 24 bits. But first 3 bits are fixed as 110; hence total number of networks possible is 2^21

•   Question 4

Which of the following transport layer protocols is used to support electronic mail?

A : SMTP
B : IP
C : TCP
D : UDP

•
.

Solution :
E-mail uses SMTP, application layer protocol which intern uses TCP transport layer protocol.

•   Question 5

Consider a random variable X that takes values + 1 and -1 with probability 0.5 each. The values of the cumulative distribution function F(x) at x = -1 and +1 are

A : 0 and 0.5
B : 0 and 1
C : 0.5 and 1
D : 0.25 and 0.75

•
.

Solution :
The cumulative distribution function F(x)=P(X<=x)
F(-1)=P(X=-1) =0.5
F(+1)=P(X<=+1) =P(X=-1) = 0.5+0.5 = 1

•   Question 6

Register renaming is done is pipelined processors

A : as an alternative to register allocation at compile time
C : to handle certain kinds of hazards
D : as part of address translation

•
.

Solution :
Register renaming is done to eliminate WAR/WAW hazards.

•   Question 7

The amount of ROM needed to implement a 4 bit multiplier is

A : 64 bits
B : 128 bits
C : 1 Kbits
D : 2 Kbits

•
.

Solution :
For a 4 bit multiplier there are 24 * 24 = 256 combinations.
Output will contain 8 bits.
So the amount of ROM needed is 8*28 bits = 2Kbits.

•   Question 8

Let W(n) and A(n) denote respectively, the worst case and average case running time of an algorithm executed on an input of size n. Which of the following is ALWAYS TRUE?

A : A(n) =Ω(W(n))
B : A(n) = θ (W(n))
C : A(n) = O(W(n))
D : A(n) = o(W(n))

•
.

Solution :
The average case time can be lesser than or even equal to the worst case. So A(n) would be upper bounded by W(n) and it will not be strict upper bound as it can even be same.

•   Question 9

Let G be a simple undirected planar graph on 10 vertices with 15edges. If G is a connected graph, then the number of bounded faces in any embedding of G on the plane is equal to

A : 3
B : 4
C : 5
D : 6

•
.

Solution :
We have the relation V-E+F=2, by this we will get the total number of faces,F = 7. Out of 7 faces one is an unbounded face, so total 6 bounded faces.

•   Question 10

The recurrence relation capturing the optimal execution time of the Towers of Hanoi problem with n discs is

A : T(n) = 2T(n - 2) + 2
B : T(n) = 2T(n - 1) + n
C : T(n) = 2T(n/2) + 1
D : T(n) = 2T(n - 1) + 1

•
.

Solution :
Let the three pegs be A,B and C, the goal is to move n pegs from A to C using peg B The following sequence of steps are executed recursively 1.move n-1 discs from A to B. This leaves disc n alone on peg A --- T(n-1)
2.move disc n from A to C---------1
3.move n-1 discs from B to C so they sit on disc n----- T(n-1)
So, T(n) = 2T(n-1) +1

•   Question 11

Which of the following statements are TRUE about an SQL query?
P : An SQL query can contain a HAVING clause even if it does not have a GROUP BY clause
Q : An SQL query can contain a HAVING clause only if it has GROUP BY clause
R : All attributes used in the GROUP BY clause must appear in the SELECT clause
S : Not all attributes used in the GROUP BY clause need to appear in the SELECT clause

A : P and R
B : P and S
C : Q and R
D : Q and S

•
.

Solution :
If we use a HAVING clause without a GROUP BY clause, the HAVING condition applies to all rows that satisfy the search condition. In other words, all rows that satisfy the search condition make up a single group. So, option P is true and Q is false.

•   Question 12

Given the basic ER and relational models, which of the following is INCORRECT?

A : An attribute of an entity can have more than one value
B : An attribute of an entity can be composite
C : In a row of a relational table, an attribute can have more than one value
D : In a row of a relational table, an attribute can have exactly one value or a NULL value

•
.

Solution :
The term ‘entity’ belongs to ER model and the term ‘relational table’ belongs to relational model. Options A and B both are true since ER model supports both multivalued and composite attributes. As multivalued attributes are not allowed in relational databases, in a row of a relational (table), an attribute cannot have more than one value.

•   Question 13

What is the complement of the language accepted by the NFA shown below?

A :
B : { ∈ }
C : a*
D : { a , ∈ }

•
.

Solution :
Language accepted by NFA is a+, so complement of this language is {∈}

•   Question 14

What is the correct translation of the following statement into mathematical logic?
“Some real numbers are rational”

A : ∃ x (real(x) v rational (x))
B : ∀x ( real(x) -> rational (x) )
C : ∃ x ( real(x) ∧ rational (x) )
D : ∃ x ( rational(x) -> real (x) )

•
.

Solution :
Option A: There exists x which is either real or rational and can be both.
Option B: All real numbers are rational
Option C: There exists a real number which is rational.
Option D: There exists some number which is not rational or which is real.

•   Question 15

Let A be the 2 x 2 matrix with elements a11 = a12 = a21= + 1 and a22 =-1. Then the eigen values of the matrix A19 are

A : 1024 and -1024
B : 1024 √2 and -1024 √2
C : 4 √2 and - 4 √2
D : 512 √2 and - 512 √2

•
.

•   Question 16

The protocol data unit (PDU) for the application layer in the Internet stack is

A : Segment
B : Datagram
C : Message
D : Frame

•
.

Solution :
The PDU for Datalink layer, Network layer , Transport layer and Application layer are frame, datagram, segment and message respectively.

•   Question 17

Consider the function f(x) = sin(x) in the interval [π/4, 7π/4]. The number and location(s) of the local minima of this function are

A : One, at π/2
B : One, at 3π / 2
C : Two, at π / 2 and 3π / 2
D : Two, at π / 4 and 3π / 2

•
.

Solution :
Sin x has a maximum value of 1 at , π/2 and a minimum value of –1 at 3π/2 and at all angles conterminal with them.
∴ In the interval [ π/4, 7π/4 ] , it has one local minimum at x= 3π/2

•   Question 18

A process executes the code
fork ();
fork ();
fork ();
The total number of child processes created is

A : 3
B : 4
C : 7
D : 8

•
.

Solution :
If fork is called n times, there will be total 2n running processes including the parent process. So, there will be 2n-1 child processes.

•   Question 19

The decimal value 0.5 in IEEE single precision floating point representation has

A : fraction bits of 000…000 and exponent value of 0
B : fraction bits of 000…000 and exponent value of -1
C : fraction bits of 100…000 and exponent value of 0
D : no exact representation

•
.

Solution :
(0.5)10 = (1.0)2 * 2-1
So, exponent = -1 and fraction is 000 - - - 000

•   Question 20

The truth table represents the Boolean function

A : X
B : X + Y
C : X ⊕ Y
D : Y

•
.

Solution :
XY'+ XY = X(Y'+ Y) = X

•   Question 21

The worst case running time to search for an element in a balanced binary search tree with n2n elements is

A : θ (n log n)
B : θ (n 2n)
C : θ (n)
D : θ (log n)

•
.

Solution :
The worst case search time in a balanced BST on ‘x’ nodes is logx. So, if x = n2n, then log(n2n) = logn + log(2n) = logn + n = θ(n)

•   Question 22

Assuming P ≠ NP, which of the following is TRUE?

A : NP-complete = NP
B : NP-complete ∩ P = ∅
C : NP-hard = NP
D : P = NP-complete

•
.

Solution :
If P!=NP, then it implies that no NP-Complete problem can be solved in polynomialtime which implies that the set P and the set NPC are disjoint.

•   Question 23

What will be the output of the following C program segment?
Char inChar = ‘A’ ;
switch (inChar ) {
case ‘A’ : printf (“Choice A\ n”);
case ‘B’ :
case ‘C’ : print f(“Choice B”);
case ‘D’ :
case ‘E’ :
default : printf (“No Choice”) ; }

A : No choice
B : Choice A
C : Choice A
Choice B No choice

D : Program gives no output as it is erroneous

•
.

Solution :
Since there is no ‘break’ statement , the program executes all the subsequent case statements after printing “choice A”

•   Question 24

Which of the following is TRUE?

A : Every relation is 3NF is also in BCNF
B : A relation R is in 3NF if every non-prime attribute of R is fully functionally dependent on every key of R
C : Every relation in BCNF is also in 3NF
D : No relation can be in both BCNF and 3NF

•
.

Solution :
Option A is false since BCNF is stricter than 3NF (it needs LHS of all FDs should be candidate key for 3NF condition)
Option B is false since the definition given here is of 2NF
Option C is true, since for a relation to be in BCNF it needs to be in 3NF, every relation in BCNF satisfies all the properties of 3NF.
Option D is false, since if a relation is in BCNF it will always be in 3NF.

•   Question 25

Consider the following logical inferences.
I1 : If it rains then the cricket match will not be played.
The cricket match was played.
Inference: There was no rain.
I2 : If it rains then the cricket match will not be played.
It did not rain.
Inference: The cricket match was played.
Which of the following is TRUE?

A : Both I1 and I2 are correct inferences
B : I1 is correct but I2 is not a correct inference
C : I1 is not correct but I2 is a correct inference
D : Both I1 and I2 are not correct inferences

•
.

•   Question 26

Consider the set of strings on {0,1} in which, every substring of 3 symbols has at most two zeros. For example, 001110 and 011001 are in the language, but 100010 is not. All strings of length less than 3 are also in the language. A partially completed DFA that accepts this language is shown below.

A : B :
C : D :

•
.

•   Question 27

The height of a tree is defined as the number of edges on the longest path in the tree. The function shown in the pseudocode below is invoked as height (root) to compute the height of a binary tree rooted at the tree pointer root.The appropriate expressions for the two boxes B1 and B2 are

A : B1 : (1 + height(n->right)), B2 : (1 + max(h1,h2))
B : B1 : (height(n->right)), B2 : (1 + max(h1,h2))
C : B1 : height(n->right), B2 : max(h1,h2)
D : B1 : (1 + height(n->right)), B2 : max(h1,h2)

•
.

Solution :
The box B1 gets exected when left subtree of n is NULL and right sbtree is not NULL. In this case, height of n will be height of right subtree plus one. The box B2 gets executed when both left and right sbtrees of n are not NULL. In this case, height of n will be max of heights of left and right sbtrees of n plus 1.

•   Question 28

Consider an instance of TCP’s Additive Increase Multiplicative decrease (AIMD) algorithm where the window size at the start of the slow start phase is 2 MSS and the threshold at the start of the first transmission is 8 MSS. Assume that a timeout occurs during the fifth transmission. Find the congestion window size at the end of the tenth transmission.

A : 8 MSS
B : 14 MSS
C : 7 MSS
D : 12 MSS

•
.

Solution :
Given, initial threshold = 8
Time = 1, during 1st transmission,Congestion window size = 2 (slow start phase)
Time = 2, congestion window size = 4 (double the no. of acknowledgments)
Time = 3, congestion window size = 8 (Threshold meet)
Time = 4, congestion window size = 9, after threshold (increase by one Additive increase)
Time = 5, transmits 10 MSS, but time out occurs congestion window size = 10
Hence threshold = (Congestion window size)/2 = 10/5= 2 =
Time = 6, transmits 2
Time = 7, transmits 4
Time = 8, transmits 5 (threshold is 5)
Time = 9, transmits 6, after threshold (increase by one Additive increase)
Time = 10, transmits 7
During 10th transmission, it transmits 7 segments hence at the end of the tenth transmission the size of congestion window is 7 MSS

•   Question 29

Consider a source computer (S) transmitting a file of size 106 bits to a destination computer (D) over a network of two routers (R1 and R2) and three links (L1, L2, and L3). L1 connects S to R1; L2 connects R1 to R2; and L3 connects R2 to D. Let each link be of length 100km. Assume signals travel over each line at a speed of 108 meters per second. Assume that the link bandwidth on each link is 1Mbps. Let the file be broken down into 1000 packets each of size 1000 bits. Find the total sum of transmission and propagation delays in transmitting the file from S to D?

A : 1005ms
B : 1010ms
C : 3000ms
D : 3003ms

•
.

Solution :
Transmission delay for 1 packet from each of S, R1 and R2 will take 1ms
Propagation delay on each link L1, L2 and L3 for one packet is 1ms
Therefore the sum of transmission delay and propagation delay on each link for one packet is 2ms.
The first packet reaches the destination at 6th ms
The second packet reaches the destination at 7th ms
So inductively we can say that 1000th packet reaches the destination at 1005th ms

•   Question 30

Suppose R1 (A, B) and R2 (C, D) are two relation schemas. Let r1 and r2 be the corresponding relation instances. B is a foreign key that refers to C in R2. If data in r1 and r2 satisfy referential integrity constrains, which of the following is ALWAYS TRUE?

A : πB(r1) - πC(r2) = ∅
B : πC(r2) - πB(r1) = ∅
C : πB(r1) = πC(r2)
D : πB(r1) - πC(r2) ≠ ∅

•
.

Solution :
Since B is a foreign key referring C,values under B will be subset of values under C ( πB (r1 ) ⊆ πC(r2) => πB(r1) - πC(r2) = ∅ )

•   Question 31

Consider the virtual page reference string
1,2,3,2,4,1,3,2,4,1
on a demand paged virtual memory system running on a computer system that has main memory size of 3 page frames which are initially empty. Let LRU, FIFO and OPTIMAL denote the number of page faults under the corresponding page replacement policy. Then

A : OPTIMAL < LRU < FIFO
B : OPTIMAL < FIFO < LRU
C : OPTIMAL = LRU
D : OPTIMAL = FIFO

•
.

Solution :
FIFO = 6 fautls
Optimal = 5 faults
LRU = 9 faults

•   Question 32

A file system with 300 GByte disk uses a file descriptor with 8 direct block addresses, 1 indirect block address and 1 doubly indirect block address. The size of each disk block is 128 Bytes and the size of each disk block address is 8 Bytes. The maximum possible file size in this file system is

A : 3 KBytes
B : 35 KBytes
C : 280 KBytes
D : dependent on the size of the disk

•
.

Solution :
Each block size = 128
Bytes Disk block address = 8 Bytes
Each disk can contain = 128 /8 =16 addresses
Size due to 8 direct block addresses: 8 x 128
Size due to 1 indirect block address: 16 x 128
Size due to 1 doubly indirect block address: 16 x 16 x 128
Size due to 1 doubly indirect block address: 16 x 16 x 128
So, maximum possible file size:
8 *128+ 16 *128 +16 *16 *128= 1024 +2048+ 32768=35840 Bytes= 35KByte

•   Question 33

Consider the directed graph shown in the figure below. There are multiple shortest paths between vertices S and T. Which one will be reported by Dijkstra’s shortest path algorithm? Assume that, in any iteration, the shortest path to a vertex v is updated only when a strictly shorter path to v is discovered.

A : SDT
B : SBDT
C : SACDT
D : SACET

•
.

•   Question 34

A list of n strings, each of length n, is sorted into lexicographic order using the merge-sort algorithm. The worst case running time of this computation is

A : O( n log n)
B : O( n2 log n)
C : O( n2 + log n )
D : O( n2 )

•
.

Solution :
The height of the recursion tree using merge sort is logn and n2 comparisons are done at each level, where at most n pairs of strings are compared at each level and n comparisons are required to compare any two strings, So the worst case running time is O(n2 log n)

•   Question 35

Let G be a complete undirected graph on 6 vertices. If vertices of G are labeled, then the number of distinct cycles of length 4 in G is equal to

A : 15
B : 30
C : 90
D : 45

•
.

Solution :
4 vertices from 6 vertices can be chosen in in 6C4. Number of cycles of length 4 that can be formed from those selected vertices is (4-1)!/2 (left or right/ up or down does not matter), so total number of 4 length cycles are (6C4.3!)/2 = 45.

•   Question 36

How many onto (or surjective) functions are there from an n-element (n >= 2) set to a 2- element set?

A : 2n
B : 2n - 1
C : 2n - 2
D : 2 ( 2n - 2 )

•
.

Solution :
Total number of functions is 2n, out of which there will be exactly two functions where all elements map to exactly one element, so total number of onto functions is 2n-2

•   Question 37

Consider the program given below, in a block-structured pseudo-language with lexical scoping and nesting of procedures permitted.
Program main;
Var . . .
Procedure A1;
Var ….
Call A2;
End A1
Procedure A2;
Var . . .
Procedure A21;
Var . . .
Call A1;
End A21
Call A21;
End A2
Call A1;
End main.
Consider the calling chain: Main -> A1 -> A2 -> A21 -> A1
The correct set of activation records along with their access links is given by

A : B :
C : D :

•
.

Solution :
Access link is defined as link to activation record of closest lexically enclosing block in program text, so the closest enclosing blocks respectively for A1 ,A2 and A21 are main , main and A2

•   Question 38

Suppose a circular queue of capacity (n – 1) elements is implemented with an array of n elements. Assume that the insertion and deletion operation are carried out using REAR and FRONT as array index variables, respectively. Initially, REAR = FRONT = 0. The conditions to detect queue full and queue empty are

A : Full: (REAR+1) mod n == FRONT, empty: REAR == FRONT
B : Full: (REAR+1) mod n == FRONT, empty: (FRONT+1) mod n == REAR
C : Full: REAR == FRONT, empty: (REAR+1) mod n == FRONT
D : Full: (FRONT+1) mod n == REAR, empty: REAR == FRONT

•
.

•   Question 39

An Internet Service Provider (ISP) has the following chunk of CIDR-based IP addresses available with it: 245.248.128.0/20. The ISP wants to give half of this chunk of addresses to Organization A, and a quarter to Organization B, while retaining the remaining with itself. Which of the following is a valid allocation of address to A and B?

A : 245.248.136.0/21 and 245.248.128.0/22
B : 245.248.128.0/21 and 245.248.128.0/22
C : 245.248.132.0/22 and 245.248.132.0/21
D : 245.248.136.0/24 and 245.248.132.0/21

•
.

Solution :
Since half of 4096 host addresses must be given to organization A, we can set 12th bit to 1 and include that bit into network part of organization A, so the valid allocation of addresses to A is 245.248.136.0/21
Now for organization B, 12th bit is set to ‘0’ but since we need only half of 2048 addresses, 13th bit can be set to ‘0’ and include that bit into network part of organization B so the valid allocation of addresses to B is 245.248.128.0/22

•   Question 40

Suppose a fair six-sided die is rolled once. If the value on the die is 1, 2, or 3, the die is rolled a second time. What is the probability that the sum total of values that turn up is at least 6?

A : 10/21
B : 5/12
C : 2/3
D : 1/6

•
.

Solution :
Required probability= 1/6 * 2/6 + 1/6* 3/6 + 1/6 * 4/6 + 1/6 = 15/36 = 5/12

•   Question 41

Fetch_And_Add (X, i) is an atomic Read-Modify-Write instruction that reads the value of memory location X, increments it by the value i, and returns the old value of X. It is used in the pseudocode shown below to implement a busy-wait lock. L is an unsigned integer shared variable initialized to 0. The value of 0 corresponds to lock being available, while any nonzero value corresponds to the lock being not available.
AcquireLock(L){
L = 1;
}
Release Lock(L){
L = 0;
}
This implementation

A : fails as L can overflow
B : fails as L can take on a non-zero value when the lock is actually available
C : works correctly but may starve some processes
D : works correctly without starvation

•
.

Solution :
1. Acquire lock (L) {
3. L = 1. }
4. Release Lock (L) {
5. L = 0;
6. }
Let P and Q be two concurrent processes in the system currently executing as follows
P executes 1,2,3 then Q executes 1 and 2 then P executes 4,5,6 then L=0 now Q executes 3 by which L will be set to 1 and thereafter no process can set
L to zero, by which all the processes could starve.

•   Question 42

Consider the 3 process, P1, P2 and P3 shown in the table.
The completion order of the 3 processes under the policies FCFS and RR2 (round robin scheduling with CPU quantum of 2 time units) are

A : FCFS: P1, P2, P3
RR2: P1, P2, P3

B : FCFS: P1, P3, P2
RR2: P1, P3, P2

C : FCFS: P1, P2, P3
RR2: P1, P3, P2

D : FCFS: P1, P3, P2
RR2: P1, P2, P3

•
.

Solution :
For FCFS Execution order will be order of Arrival time so it is P1,P2,P3
Next For RR with time quantum=2,the arrangement of Ready Queue will be as follows:
RQ: P1,P2,P1,P3,P2,P1,P3,P2
This RQ itself shows the order of execution on CPU(Using Gantt Chart) and here it gives the completion order as P1,P3,P2 in Round Robin algorithm.

•   Question 43

What is the minimal form of the Karnaugh map shown below? Assume that X denotes a don’t care term.

A : b`d`
B : b`d`+b`c`
C : b`d` + a(bc)`d
D : b`d`+b`c`+c`d`

•
.

Solution :
d 'b '+ c 'b '

•   Question 44

Let G be a weighted graph with edge weights greater than one and G’ be the graph constructed by squaring the weights of edges in G. Let T and T’ be the minimum spanning trees of G and G’ respectively, with total weights t and t’. Which of the following statements is TRUE?

A : T’ = T with total weight t’ = t2
B : T’ = T with total weight t’ < t2
C : T’ ≠ T but total weight t’ = t2
D : None of the above

•
.

Solution :
Graph G is counter example for options (B) and (C) and Graph G1 is counter example for option (A)

•   Question 45

The bisection method is applied to compute a zero of the function f(x) = x^4 -x^3 - x^2 – 4 in the interval [1,9]. The method converges to a solution after ______ iterations.

A : 1
B : 3
C : 5
D : 7

•
.

•   Question 46

Which of the following graph is isomorphic to

A : B :
C : D :

•
.

Solution :
The graph in option (A) has a 3 length cycle whereas the original graph does not have a 3 length cycle
The graph in option (C) has vertex with degree 3 whereas the original graph does not have a vertex with degree 3
The graph in option (D) has a 4 length cycle whereas the original graph does not have a 4 length cycle

•   Question 47

Consider the following transactions with data items P and Q initialized to zero:
if P = 0 then Q : = Q + 1 ;
write (Q).
if Q = 0 then P : = P + 1 ;
write (P).
Any non-serial interleaving of T1 and T2 for concurrent execution leads to

A : a serializable schedule
B : a schedule that is not conflict serializable
C : a conflict serializable schedule
D : a schedule for which precedence graph cannot be drawn

•
.

•   Question 48

Consider the following relations A, B and C:
How many tuples does the result of the following SQL query contain?
SELECT A.Id
FROM A
WHERE A.Age > ALL(SELECT B.Age
FROM B
WHERE B.Name = ‘Arun’)

A : 4
B : 3
C : 0
D : 1

•
.

Solution :
As the result of subquery is an empty table, ‘>ALL’ comparison is true . Therefore, all the three row id’s of A will be selected from table A.

•   Question 49

Consider the following relations A, B and C:
How many tuples does the result of the following relational algebra expression contain? Assume that the schema of A U B is the same as that of A.
(A U B) <> A.id>40 ∨ C.id <15 C

A : 7
B : 4
C : 5
D : 9

•
.

•   Question 50

Consider the following C code segment:
int a, b, c = 0;
void prtFun(void);
main( )
{
static int a = 1; /* Line 1 */
prtFun( );
a + = 1;
prtFun( )
printf(“\n %d %d “, a, b);
}
void prtFun(void)
{ static int a=2; /* Line 2 */
int b=1;
a+=++b;
printf(“\n %d %d “, a, b);
}
What output will be generated by the given code segment if:
Line 1 is replaced by auto int a = 1;
Line 2 is replaced by register int a = 2;

A : 3 1
4 1
4 2

B : 4 2
6 1
6 1

C : 4 2
6 2
2 0

D : 4 2
4 2
2 0

•
.

Solution :
Static local variables: Scope is limited to function/block but life time is entire program.
Automatic local variables: Storage allocated on function entry and automatically deleted or freed when the function is exited.
Register variables: Same as automatic variables except that the register variables will not have addresses Hence may not take the address of a register variable.

•   Question 51

Consider the following C code segment:
int a, b, c = 0;
void prtFun(void);
main( )
{
static int a = 1; /* Line 1 */
prtFun( );
a + = 1;
prtFun( )
printf(“\n %d %d “, a, b);
}
void prtFun(void)
{ static int a=2; /* Line 2 */
int b=1;
a+=++b;
printf(“\n %d %d “, a, b);
}
What output will be generated by the given code segment?

A : 3 1
4 1
4 2

B : 4 2
6 1
6 1

C : 4 2
6 2
2 0

D : 3 1
5 2
5 2

•
.

•   Question 52

A computer has a 256 KByte, 4-way set associative, write back data cache with block size of 32 Bytes. The processor sends 32 bit addresses to the cache controller. Each cache tag directory entry contains, in addition to address tag, 2 valid bits, 1 modified bit and 1 replacement bit.
The number of bits in the tag field of an address is

A : 11
B : 14
C : 16
D : 27

•
.

Solution :
Number of blocks == 256KB/32Byte = 213blocks
As it is 4–way set associative, number of sets = 2^13 / 2^2 = 211

•   Question 53

A computer has a 256 KByte, 4-way set associative, write back data cache with block size of 32 Bytes. The processor sends 32 bit addresses to the cache controller. Each cache tag directory entry contains, in addition to address tag, 2 valid bits, 1 modified bit and 1 replacement bit.
The size of the cache tag directory is

A : 160 Kbits
B : 136 Kbits
C : 40 Kbits
D : 32 Kbits

•
.

Solution :
TAG controller maintains 16 + 4 = 20 bits for every block
Hence, size of cache tag directory = 20 × 213 bits =160 Kbits

•   Question 54

For the grammar below, a partial LL(1) parsing table is also presented along with the grammar. Entries that need to be filled are indicated as E1, E2, and E3. ε is the empty string, \$ indicates end of input, and, | separates alternate right hand sides of productions.

A : B :
C : D :

•
.

Solution :
First (A) = First (S) = First (aAbB) U First (bAaB) U First (ε)
={a} U {b} U {ε} = {ε , a,b}
First (B)= First (S) = {ε,a,b}
Follow (A) = First (bB) = First (aB) = {a,b}

•   Question 55

For the grammar below, a partial LL(1) parsing table is also presented along with the grammar. Entries that need to be filled are indicated as E1, E2, and E3. ε is the empty string, \$ indicates end of input, and, | separates alternate right hand sides of productions.
The appropriate entries for E1, E2, and E3 are

A : E1: S->aAbB, A->S
E2: S->bAaB, B->S
E3: B->S

B : E1: S->aAbB, S->ε
E2: S->bAaB, S->ε
E3: S->ε

C : E1: S->aAbB, S->ε
E2: S->bAaB, S->ε
E3: B->S

D : E1: A->S, S->ε
E2: B->S, S->ε
E3 : B ->S

•
.

•   Question 56

The cost function for a product in a firm is given by 5q2 , where q is the amount of production. The firm can sell the product at a market price of Rs.50 per unit. The number of uni ts to be produced by the firm such that the profit is maximized is

A : 5
B : 10
C : 15
D : 25

•
.

Solution :
p=50q-5q2
dp/dq = 50 -10q =0 or q=5

•   Question 57

Choose the most appropriate alternative from the options given below to complete the following sentence:
Suresh’s dog is the one ________ was hurt in the stampede.

A : that
B : which
C : who
D : whom

•
.

•   Question 58

Choose the grammatically INCORRECT sentence:

A : They gave us the money back less the service charges of Three Hundred rupees.
B : This country's expenditure is not less than that of Bangladesh.
C : The committee initially asked for a funding of Fifty Lakh rupees, but later settled for a lesser sum.
D : This country's expenditure on educational reforms is very less

•
.

•   Question 59

Which one of the following options is the closest in meaning to the word given below?
Mitigate

A : Diminish
B : Divulge
C : Dedicate
D : Denote

•
.

•   Question 60

Choose the most appropriate alternative from the options given below to complete the following sentence:
Despite several __________ the mission succeeded in its attempt to resolve the conflict.

A : attempts
B : setbacks
C : meetings
D : delegations

•
.

•   Question 61

Wanted Temporary, Part-time persons for the post of Field Interviewer to conduct personal interviews to collect and collate economic data. Requirements: High School-pass, must be available for Day, Evening and Saturday work. Transportation paid, expenses reimbursed. Which one of the following is the best inference from the above advertisement?

A : Gender-discriminatory
B : Xenophobic
C : Not designed to make the post attractive
D : Not gender-discriminatory

•
.

Solution :

•   Question 62

Given the sequence of terms, AD CG FK JP, the next term is

A : OV
B : OW
C : PV
D : PW

•
.

•   Question 63

Which of the following assertions are CORRECT?
P: Adding 7 to each entry in a list adds 7 to the mean of the list
Q: Adding 7 to each entry in a list adds 7 to the standard deviation of the list
R: Doubling each entry in a list doubles the mean of the list
S: Doubling each entry in a list leaves the standard deviation of the list unchanged

A : P,Q
B : Q,R
C : P,R
D : R,S

•
.

Solution :
P and R always hold true
Else consider a sample set {1, 2, 3, 4} and check accordingly

•   Question 64

An automobile plant contracted to buy shock absorbers from two suppliers X and Y. X supplies 60% and Y supplies 40% of the shock absorbers. All shock absorbers are subjected to a quality test. The ones that pass the quality test are considered reliable Of X's shock absorbers, 96% are reliable. Of Y's shock absorbers, 72% are reliable.
The probability that a randomly chosen shock absorber, which is found to be reliable, is made by Y is

A : 0.288
B : 0.334
C : 0.667
D : 0.720

•
.

•   Question 65

A political party orders an arch for the entrance to the ground in which the annual convention is being held. The profile of the arch follows the equation y = 2x - 0.1x2 where y is the height of the arch in meters. The maximum possible height of the arch is

A : 8 meters
B : 10 meters
C : 12 meters
D : 14 meters

•
.