CS Gate 20101
CS Gate 20101
CS Gate 20101
com
(B)
-1 (C)
(D)
(A)
S
=2
T
S
=
T
S
=
T
S
=
T
+
1
2.
Newton-Raphson method is used to compute a root of the equation x2-
13 =
0
with 3.5 as the initial value. The approximation after one iteration is
(A) 3.575 (B) 3.676 (C) 3.667 (D) 3.607
3.
What is the possible number of reflexive relations on a set of 5 elements?
(A) 210
(B) 215 (C) 220 (D)225
4.
Consider the set S = {1, ., .2}, where . and .2 are cube roots of unity. If *
denotes the multiplication operation, the structure (S, *) forms
(A) A group
(B) A ring
(C) An integral domain
(D) A field
.
1.2n
5.
What is the value of lim 1 -
?
..
n.8
.
n.
(A) 0
(B) e-2 (C) e-1/2 (D)1
6.
The minterm expansion of f (P, Q, R) =
PQ +
QR +PR is
(A) m
+
m +
m +m (B) m +
m +
m +m
2467
0135
(C) m
+
m +
m +m (D) m +
m +
m +
m
0167
2345
7.
A main memory unit with a capacity of 4 megabytes is built using 1M×1-bit
DRAM chips. Each DRAM chip has 1K rows of cells with 1K cells in each row. The
time taken for a single refresh operation is 100 nanoseconds. The time required
to perform one refresh operation on all the cells in the memory unit is
(A) 100 nanoseconds
(B) 100*210 nanoseconds
(C) 100*220 nanoseconds
(D) 3200*220 nanoseconds
8.
P is a 16-bit signed integer. The 2 s complement representation of P is (F87B)16.
The 2 s complement representation of 8*P is
(A) (C3D8) (B) (187B) (C) (F878) (D) (987B )
16
16 1616
www.way2freshers.com
9. The Boolean expression for the output f of the multiplexer shown below is
(A) P Q R.
.R
R
(B) P Q R.
.R
R
(C) PQ R+
+
f
PQ
(D)PQ +
R
+
10.
In a binary tree with n nodes, every node has an odd number of descendants.
Every node is considered to be its own descendant. What is the number of nodes
in the tree that have exactly one child?
(A)0
(B) 1 (C) (n1 /2 (D)n-1
-)
11.
What does the following program print?
#include <
stdio.h >
voidf int*p,int*g {
()
p =
q;
*p =
2;
}
int i =
0, j =
1;
int main ( ){
(A)2 2
(B) 2 1 (C)0 1 (D)0 2
12.
Two alternative packages A and B are available for processing a database having
10k records. Package A requires 0.0001n2 time units and package B requires
10nlog10n time units to process n records. What is the smallest value of k for
which package B will be preferred over A?
(A) 12
(B) 10 (C) 6 (D)5
13.
Which data structure in a compiler is used for managing information about
variables and their attributes?
(A) Abstract syntax tree
(B) Symbol table
(C) Semantic stack
(D) Parse table
www.way2freshers.com
14.
Which languages necessarily need heap allocation in the runtime environment?
(A) Those that support recursion (B) Those that use dynamic scoping
(C) Those that allow dynamic data structures (D) Those that use global variables
15.
One of the header fields in an IP datagram is the Time to Live (TTL) field. Whic
h
of the following statements best explains the need for this field?
(A) It can be used to prioritize packets
(B) It can be used to reduce delays
(C) It can be used to optimize throughput
(D) It can be used to prevent packet looping
16.
Which one of the following is not a client server application?
(A) Internet chat (B) Web browsing (C) E-mail (D)Ping
17.
Let L1 be a recursive language. Let L2 and L3 be languages that are recursively
enumerable but not recursive. Which of the following statements is not
necessarily true?
(A) L2 L1 is recursively enumerable
(B) L1 L3 is recursively enumerable
(C) L2 n L1 is recursively enumerable
(D) L2 . L1 is recursively enumerable
18.
Consider a B+-tree in which the maximum number of keys in a node is 5. What is
the minimum number of keys in any non-root node?
(A)1
(B) 2 (C)3 (D)4
19.
A relational schema for a train reservation database is given below
Passenger pid, pname, age
(
)
Table:Passenger Table:Reservation
pid 'pname Age
0 'Sachin' 65
1 'Rahul' 66
2 'Sourav' 67
3 ' Anil' 69
pid class tid
0 ' AC' 8200
1 ' AC' 8201
2 'SC' 8201
5 ' AC' 8203
1 'SC' 8204
3 ' AC' 8202
A A
www.way2freshers.com
What pids are returned by the following SQL query for the above instance of the
tables?
SELECT pid
FROM Reservation
WHERE class =
'AC' AND
EXISTS (SELECT *
FROM Passenger
WHERE age >
65 AND
Passenger.pid =
Reservation.pid)
(A) 1, 0 (B) 1, 2 (C) 1, 3 (D)1, 5
20.
Which of the following concurrency control protocols ensure both conflict
serializability and freedom from deadlock?
I. 2-phase locking
II. Time-stamp ordering
(A) I only
(B) II only
(C) Both I and II
(D) Neither I nor II
21.
The cyclomatic complexity of each of the modules A and B shown below is
10. What is the cyclomatic complexity of the sequential integration shown on
the right hand side?
B
(A) 19
(B) 21 (C) 20 (D) 10
22.
What is the appropriate pairing of items in the two columns listing various
activities encountered in a software life cycle?
P. Requirements Capture 1. Module Development and Integration
Q. Design
2. Domain Analysis
R. Implementation
3. Structural and Behavioral Modeling
S. Maintenance
4. Performance Tuning
(A) P-3, Q-2,R-4,S-1
(B) P-2, Q-3,R-1,S-4
(C) P-3, Q-2,R-1,S-4
(D) P-2, Q-3,R-4,S-1
A
B
www.way2freshers.com
23.
Consider the methods used by processes P1 and P2 for accessing their critical
sections whenever needed, as given below. The initial values of shared boolean
variables S1 and S2 are randomly assigned.
Method used by PI Method used by P2
while (S1 = = S2) ;
Critica1 Section
S1 = S2;
while (S1 != S2) ;
Critica1 Section
S2 = not (S1);
Which one of the following statements describes the properties achieved?
(A) Mutual exclusion but not progress
(B) Progress but not mutual exclusion
(C) Neither mutual exclusion nor progress
(D) Both mutual exclusion and progress
24.
A system uses FIFO policy for page replacement. It has 4 page frames with no
pages loaded to begin with. The system first accesses 100 distinct pages in some
order and then accesses the same 100 pages but now in the reverse order. How
many page faults will occur?
(A) 196 (B) 192 (C) 197 (D) 195
25.
Which of the following statements are true?
I. Shortest remaining time first scheduling may cause starvation
II. Preemptive scheduling may cause starvation
III. Round robin is better than FCFS in terms of response time
(A) I only (B) I and III only (C) II and III only (D) I, II and III
Q. No. 26 51 Carry Two Marks Each
26.
Consider a company that assembles computers. The probability of a faulty
assembly of any computer is p. The company therefore subjects each
computer to a testing process. This testing process gives the correct result for
any computer with a probability of q. What is the probability of a computer
being declared faulty?
1 )(
-
1p q (D)pq
(A) pq +(
-
p1 -q)
(B) (1qp) (C) (-)
27.
What is the probability that divisor of 1099 is a multiple of 1096?
(A) 1/625 (B) 4/625 (C) 12/625 (D) 16/625
28.
The degree sequence of a simple graph is the sequence of the degrees of the
nodes in the graph in decreasing order. Which of the following sequences can not
be the degree sequence of any graph?
I. 7, 6, 5, 4, 4, 3, 2, 1
II. 6, 6, 6, 6, 3, 3, 2, 2
www.way2freshers.com
29.
30.
31.
32.
III. 7, 6, 6, 4, 4, 3, 2, 2 IV. 8, 7, 7, 6, 4, 2, 1, 1
(A) I and II (B) III and IV (C) IV only (D) II and IV
Consider the following matrix
.23.
A
=.
.
xy
..
f
P
R
(C)PR
+
Q
(D)PQ +RR
+
In the sequential circuit shown below, if the initial value of the output Q1Q0 i
s 00,
what are the next four values of Q1Q0?
(A) 11,10,01,00
(B) 10,11,01,001
Clock
(C) 10,00,01,11
(D) 11,10,00,01
T Q T Q
Q0 Q1
www.way2freshers.com
33.
A 5-stage pipelined processor has Instruction Fetch (IF), Instruction Decode (ID
),
Operand Fetch (OF), Perform Operation (PO) and Write Operand (WO) stages.
The IF, ID, OF and WO stages take 1 clock cycle each for any instruction. The PO
stage takes 1 clock cycle for ADD and SUB instructions, 3 clock cycles for MUL
instruction, and 6 clock cycles for DIV instruction respectively. Operand
forwarding is used in the pipeline. What is the number of clock cycles needed to
execute the following sequence of instructions?
Instruction Meaning of instruction
I :MULR ,R ,R R .
R *R
0 201 2 01
I :DIVR ,R ,R R .
R /R
1 534 5 34
I :ADDR ,R ,R R .
R +
R
2 252 2 52
I :SUBR ,R ,R R .
R -R
3 526 5 26
(A) 13
(B) 15 (C) 17 (D) 19
34.
The weight of a sequence a0, a1, ,an-1 of real numbers is defined as
-
a0 +
a1 /2 +
... +
an 1 -
/2 n1. A subsequence of a sequence is obtained by deleting
some elements from the sequence, keeping the order of the remaining elements
the same. Let X denote the maximum possible weight of a subsequence of
a ,a ,...,an 1. Then X is equal to
01-
(A) max Y, a 0 +
Y (B) max Y, a 0+
Y/2 (C) max Y, a 0+
2Y (D) +
Y /2
()
()()
a0
35.
What is the value printed by the following C program?
#include <
stdio.h >
int f(int * a, int n)
{
if (n <=
0)return 0;
else if(*a % 2 ==
0) return * a +
f(a +
1,n -
1);
else return * a -
f(a +
1, n -
1);
}
intmain( )
{
int a[] ={12, 7, 13, 4, 11, 6};
printf("%d", f(a,6));
return 0;
}
(A) -9 (B) 5
(C) 15 (D)19
36.
The following C function takes a simply-linked list as input argument. It modifi
es
the list by moving the last element to the front of the list and returns the
modified list. Some part of the code is left blank.
www.way2freshers.com
} Node;
Node *move_to_front(Node *head) {
Node *p, *q;
if ((head = = NULL: || (head->next = = NULL)) return head;
q = NULL; p = head;
while (p-> next !=NULL) {
q=P;
p=p->next;
}
return head;
}
Choose the correct alternative to replace the blank line.
b10
=
c =20
dab
=+
e =+cd
f =+ce
b =+ce
ebf
=+
d5
e
=+
return d +f
Assuming that all operations take their operands from registers, what is the
minimum number of registers needed to execute this program without spilling?
(A)2
(B) 3 (C)4 (D)6
38.
The grammar S .aSa|bS|c is
(A) LL(1) but not LR(1)
(B) LR(1) but not LR(1)
(C) Both LL(1) and LR(1)
(D) Neither LL(1) nor LR(1)
www.way2freshers.com
39. Let L =w .0 +1 *|w has even number of 1s , i.e. L is the set of all bit stri
ngs
{()
}
with even number of 1s. Which one of the regular expressions below represents
L?
(A) (0*10*1 *
(B)
)
(C) 0* 10*1* *0*()
(D)
ij
40. Consider the languages L1 =01 |i .j .L2
{}
0* 10*10* *
()
0*1 10*1 *10*
()
ij ij
=01 |i =j .L3 =01 |i =2j +1.
{}{
}
ij
L4 =01 |i .2j . Which one of the following statements is true?
{}
Read Y
()
Read Y
()
Write Y
()
Write X
()
Write X
()
Read X
()
Write X
()
Which one of the schedules below is the correct serialization of the above?
(A) T1 .T3 .T2
(B) T2 .T1 .T3
(C) T2 .T3 .T1
(D) T3 .T1 .T2
43.
The following functional dependencies hold for relations R(A, B, C) and S(B, D,
E)
B .A,
A .C
The relation R contains 200tuples and the relation S contains 100tuples. What is
the maximum number of tuples possible in the natural join R
S?
(A) 100 (B) 200 (C) 300 (D) 2000
www.way2freshers.com
44.
The following program is to be tested for statement coverage:
begin
if (a ==b){
S1; exit; }
(
){}
else if
c ==d S2;
else S3; exit;
S4;
end
The test cases T1, T2, T3 and T4 given below are expressed in terms of the
properties satisfied by the values of variables a, b, c and d. The exact values
are
not given.
T1 : a, b, c and d are all equal
T2 : a, b, c and d are all distinct
T3 : a=b and c !=d
T4 : a !=b and c=d
Which of the test suites given below ensures coverage of statements S1, S2, S3
and S4?
{}
(A) T1, T2, T3 (B) T2, T4 (C) T3, T4 (D) T1, T2, T4
45.
The following program consists of 3 concurrent processes and 3 binary
semaphores. The semaphores are initialized as S0=1, S1=0, S2=0.
Process P0 Process P1 Process P2
com
while (true) {
wait (S0);
print 0
release (S1);
release (S2);
}
www.wwait (S1);
Release (S0); ay2freshers.wait (S2);
release (S0);
How many times will process P0 print 0 ?
(A) At least twice (B) Exactly twice (C) Exactly thrice (D)Exactly once
46.
A system has n resources R0, ,Rn-1, and k processes P0, ..Pk-1. The
implementation of the resource request logic of each process Pi. is as follows:
if (i% 2==0) {
if (i<n) request R ;
i
if (i+2<n)request R i+2 ;
}
else {
n-i-2
}
In which one of the following situations is a deadlock possible?
(A) n =40,k =26 (B) n21,k ==12 (C) n20,k ==10 (D)n =41,k =19
www.way2freshers.com
47.
48.
49.
50.
51.
Suppose computers A and B have IP addresses 10.105.1.113 and 10.105.1.91
respectively and they both use the same net mask N. Which of the values of N
given below should not be used if A and B should belong to the same network?
(A) 255.255.255.0 (B) 255.255.255.128
(C) 255.255.255.192 (D) 255.255.255.224
Common Data Questions: 48 & 49
A computer system has an L1 cache, an L2 cache, and a main memory unit
connected as shown below. The block size in L1 cache is 4 words. The block size
in L2 cache is 16 words. The memory access times are 2 nanoseconds.
20 nanoseconds and 200 nanoseconds for L1 cache, L2 cache and main memory
unit respectively.
Data Bus
Data Bus
Main
Cache
L1
L2
Memory
Cache
4words
4words
When there is a miss in L1 cache and a hit in L2 cache, a block is transferred
from L2 cache to L1 cache. What is the time taken for this transfer?
(A) 2 nanoseconds (B) 20 nanoseconds
(C) 22 nanoseconds (D) 88 nanoseconds
When there is a miss in both L1 cache and L2 cache, first a block is transferred
from main memory to L2 cache, and then a block is transferred from L2 cache to
L1 cache. What is the total time taken for these transfers?
(A) 222 nanoseconds (B) 888 nanoseconds
(C) 902 nanoseconds (D) 968 nanoseconds
Common Data Questions: 50 & 51
Consider a complete undirected graph with vertex set {0, 1, 2, 3, 4}. Entry Wij
in
the matrix W below is the weight of the edge {i, j}.
.01 814.
..
10 12 49
..
W =.812 0 73.
..
14 702
..
..
49 320
..
What is the minimum possible weight of a spanning tree T in this graph such that
vertex 0 is a leaf node in the tree T?
(A) 7 (B) 8 (C) 9 (D)10
What is the minimum possible weight of a path P from vertex 1 to vertex 2 in thi
s
graph such that P contains at most 3 edges?
(A) 7 (B) 8 (C) 9 (D)10
www.way2freshers.com
A hash table of length 10 uses open addressing with hash function h(k)=k
mod 10, and linear probing. After inserting 6 values into an empty hash table,
the table is as shown below
0
1
2 42
3 23
4 34
5 52
6 46
7 33
8
9
52.
Which one of the following choices gives a possible order in which the key value
s
could have been inserted in the table?
(A) 46, 42, 34, 52, 23, 33
(B) 34, 42, 23, 52, 33, 46
(C) 46, 34, 42, 23, 52, 33
(D) 42, 46, 33, 23, 34, 52
53.
How many different insertion sequences of the key values using the same hash
function and linear probing will result in the hash table shown above?
(A) 10
(B) 20 (C) 30 (D) 40
Statement for Linked Answer Questions: 54 & 55
Consider a network with 6 routers R1 to R6 connected with links having
weights as shown in the following diagram
R4R2
R1
R3
R5
R6
7
6
3
2 1
8
4
9
54.
All the routers use the distance vector based routing algorithm to update their
routing tables. Each router starts with its routing table initialized to contain
an
entry for each neighbour with the weight of the respective connecting link.
After all the routing tables stabilize, how many links in the network will never
be used for carrying any data?
(A)4
(B) 3 (C)2 (D)1
www.way2freshers.com
55.
Suppose the weights of all unused links in the previous question are changed
to 2 and the distance vector algorithm is used again until all routing tables
stabilize. How many links will now remain unused?
(A)0
(B) 1 (C)2 (D)3
Q. No. 56 60 Carry One Mark Each
56.
Choose the most appropriate word from the options given below to the complete
the following sentence:
His rather casual remarks on politics ___________ his lack of seriousness about
the subject.