GATE IT – 2005
Q.1 œ Q.30 Carry One Mark Each
1. A bag contains 10 blue marbles, 20 green marbles and 30 red marbles. A marble
is drawn from the bag, its colour recorded and it is put back in the bag. This
process is repeated 3 times. The probability that no two of the marbles drawn have the same colour is
(A) 1
36 (B) 1 6 (C) 1 4 (D) 1 3
2. If the trapezoidal method is used to evaluate the integral x dx , then the value 2 0
obtained
(A) is always > 1
3 (B) is always < 1 3 (C) is always = 1 3
(D) may be greater or lesser than 1
3
3. The determinant of the matrix given below is
» ÿ 0 1 0 2
… Ÿ
- 1 1 1 3
… Ÿ
… Ÿ 0 0 0 1
… Ÿ
… Ÿ 1 2 0 1 – /
(A) -1 (B) 0 (C) 1 (D) 2
4. Let L be a regular language and M be a context free language, both over the
ƒ . alphabet Let L and M denote the complements of L and M respectively. c c
Which of the following statements about the language L M is TRUE? c c
(A) It is necessa rily regular but not necessarily context free
(B) It is necessa rily context free
(C) It is necessa rily non-regular
(D) None of the above
5. Which of the following statements is TRUE about the regular expression 01*0?
(A) It represents a finite set of finite strings.
(B) It represents an infinite set of finite strings.
(C) It represents a finite set of infinite strings.
(D) It represents an infinite set of infinite strings.
{ }
6. The language 0 1 2 1 10 is: = = n n n n 6
(A) regular (B) context free but not regular
(C) context free but its complement is not context free
(D) not context free
( ) 7. Which of the following expressions is equivalent to A B C
( ) ( )
( ) ( ) (A) A B C A B C + + + + (B) A B C A B C + + + +
( ) ( ) (C) ABC A B C B A C + + (D) None of the above
8. Using Booth‘s algorithm for multiplication, the multiplier œ 57 will be recorded as
(A) 0 œ1 0 0 1 0 0 -1 (B) 1 1 0 0 0 1 1 1
(C) 0 -1 0 0 1 0 0 0 (D) 0 1 0 0 -1 0 0 1
9. A dynamic RAM has a memory cycle time of 64 nsec. It has to be refreshed 100 times per msec and each refresh takes 100 nsec. What percentage of the memory cycle time is used for refreshing?
(A) 10 (B) 6.4 (C) 1 (D) 0.64
10. A two-way switch has three terminals a, b and c. In ON position (logic value 1) a is connected to b, and in OFF position, a is connected to c. two of these two way switches S1 and S2 are connected to a bulb as shown below.
Which of the following expressions, if true, will always result in the lighting of the bulb?
(A) 1. 2 S S (B) S1+S2 (C) 1 2 S S (D) S S 1 2
11. How many pulses are needed to change the contents of a 8 bit up-counter from 10101100 to 00100111 (rightmost bit is the LSB)?
(A) 134 (B) 133 (C) 124 (D) 123
12. The numbers 1, 2, … n are inserted in a binary search tree in some order. In the resulting tree, the right subtree of the root contains p nodes. The first number to be inserted in the tree must be
(A) p (B) p + 1 (C) n – p (D) n œ p + 1
13. A function f defined on stacks of integers satisfies the following properties.
( ) ( ) ( ) ( ) ( ) f f = 0 and f push S i f S i , max , 0 = + for all stacks S and integers i.
If a stack S contains the integers 2, -3, 2, -1, 2 in order from bottom to top,
( ) what is f S ?
(A) 6 (B) 4 (C) 3 (D) 2
14. In a depth first traversal of a graph G with n vertices, k edges are marked as tree edges. The number of connected components in G is
(A) k (B) k + 1 (C) n œ k – 1 (D) n – k
15. In the following table, the left column contains the names of standard graph
algorithm, and the right column contains the time complexities of the algorithms.
Match each algorithm with its time complexity.
(1) Bellman Ford algorithm (A) O (mlog n)
( )
(2) Kruskal‘s algorithm (B) O n 3
(3) Floyd-Warshall algorithm (C) O (nm)
(4) Topological Sorting (D) O (n + m)
(A) 1 – C 2 – A 3 – B 4 – D (B) 1 – B 2 – D 3 – C 4 – A
(C) 1 – C 2 – D 3 – A 4 – B (D) 1 – B 2 – A 3 – C 4 – D
16. A hash table contains 10 buckets and uses linear probing to resolve collisions.
The key values are integers and the hash function used is key % 10. if the values
43, 165, 62, 123, 142 are inserted in the table, in what location would the key
value 142 be inserted?
(A) 2 (B) 3 (C) 4 (D) 6
17. A student wishes to create symbolic links in a computer system running Unix.
Three text files named —file 1“, —file 2“, and —file 3“ exist in her current working directory and the student has read and write permissions for all three files.
Assume that file 1 contains information about her hobbies, file 2 contains
information about her friends and file 3 contains information about her courses.
The student executes the following sequence of commands from her current
working directory?
ln œ s file 1 file 2
ln œ s file 2 file 3
Which of the following types of information would be lost from her file system
I. Hobbies
II. Friends
III. Courses
(A) I and II only (B) II and III only (C) II only (D) I and III only
18. The shell command
find. œname passwd œprint is executed in/etc directory of a computer system running Unix. Which of the following shell commands will give the same information as the above command when executed in the same directory?
(A) ls passwd (B) cat passwd
(C) grep name pa sswd (D) grep print passwd
19. A user level process in Unix traps the signal sent on a Ctrl-C input, and has a
signal handling routine that saves appropriate files before terminating the
process. When a Ctrl-C input is given to this process, what is the mode in which
the signal handling routine executes?
(A) kernel mode (B) superuser mode
(C) privileged mode (D) user mode
20. The Function Point (FP) calculated for a software project are often used to obtain an estimate of Lines of Code (LOC) required for that project. Which of the following statements if FALSE in this context.
(A) The relationship between FP and LOC depends on the programming language used to implement the software.
(B) LOC requirement for an assembly language implementation will be more for a given FP value, than LOC for implementation in COBOL.
(C) On an average, one LOC of C++ provides approximately 1.6 times the
functionality of a single LOC of FORTRAN.
(D) FP and LOC are not related to ea ch other.
21. Consider the entities ”hotel room‘, and ”person‘ with a many to many relationship ”lodging‘ as shown below:
Hotel Room Lodging Person
If we wish to store information about the rent payment to be made by person(s)
occupying different hotel rooms, then this information should appear as an
attribute of
(A) Person (B) Hotel Room (C) Lodging (D) None of these
22. A table has fields F1, F2, F3, F4, F5 with the following functional dependencies
F1 ‰ F3 F2 ‰ F4 (F1.F2) ‰ F5
In terms of Normalization, this table is in
(A) 1 NF (B) 2 NF (C) 3 NF (D) None of these
23. A B-tree used as an index for a large database table has four levels including the
root node. If a new key is inserted in this index, then the maximum number of
nodes that could be newly created in the process a re
(A) 5 (B) 4 (C) 3 (D) 2
24. Amongst the ACID properties of a transaction, the ”Durability‘ property requires
that the changes made to the database by a successful transaction persist
(A) except in case of an Operating System crash
(B) except in case of Disk crash
(C) except in case of a power failure
(D) always, even if there is a failure of any kind
25. Consider the three commands: PROMPT, HEAD and RCPT.
Which of the following options indicate a correct association of these commands
with protocols where these are used?
(A) HTTP, SMTP, FTP (B) FTP, HTTP, SMTP
(C) HTTP, FTP, SMTP (D) SMTP, HTTP, FTP
26. Trace-route reports a possible route that is taken by packets moving from some
host A to some other host B. which of the following options represents the
technique used by trace-route to identify these hosts?
(A) By progressively querying routers about the next router on the path to B using ICMP packets, starting with the first router.
(B) By requiring each router to append the address to the ICMP packet a s it is forwarded to B. The list of all routers en-route to B is returned by B in an
ICMP reply packet.
(C) By ensuring that an ICMP reply packet is returned to A by each router en-route to B, in the ascending order of their hop distance from A
(D) By locally computing the shortest path from A to B
27. Which of the following statements is TRUE about CSMA/CD
(A) IEEE 802.11 wireless LAN runs CSMA/CD protocol
(B) Ethernet is not based on CSMA/CD protocol
(C) CSMA/CD is not suitable for a high propagation delay network like statellite
network.
(D) There is no contention in a CSMA/CD network
28. Which of the following statements is FALSE regarding a bridge
(A) Bridge is a layer 2 device
(B) Bridge reduces collision domain
(C) Bridge is used to connect two or more LAN segments
(D) Bridge reduces broadcast domain
29. Count to infinity is a problem associated with
(A) link state routing protocol (B) distance vector routing protocol
(C) DNS while resolving host name (D) TCP for congestion control
30. A HTML form is to be designed to enable purchase of office stationery. Required items are to be selected (checked). Credit card details are to be entered and then the submit button is to be pressed. Which one of the following options would be appropriate for sending the data to the server? Assume that security is handled
in a way that is transparent to the form design.
(A) only GET (B) only POST
(C) either of GET or POST (D) neither gET not POST
Q.31 œ Q.80 Carry Two Marks Each.
31. Let f be a function from a set A to a set B, g a function from B to C, and h a
( ) ( ) ( )
function from A to C, such that h a g f a = for all . a A Which of the following
statements is always true for all such functions f and g?
(A) g is onto h is onto (B) h is onto f is onto
(C) h is onto g is onto (D) h is onto f and g are onto
32. Let A be a set with n elements. Let C be a collection of distinct subsets of A such
that for any two subsets S S in C, either and S S S S or . What is the
1 2 1 2 2 1
maximum cardinality of C?
(A) n (B) n+1 (C) 2 1 + (D) n! n – 1
33. An unbiased coin is tossed repeatedly until the outcome of two successive tosses
is the same. Assuming that the trials are independent, the expected number of tosses is:
(A) 3 (B) 4 (C) 5 (D) 6
34. Let n pq = , where p and q are distinct prime numbers. How many numbers m 2 ( ) ( )satisfy 1 m n = = and gcd , 1? m n = Note that gcd , m n is the greatest common divisor of m and n.
( )
(A) p q – 1 (B) pq
( ) ( ) ( ) ( )
(C) p q – - 1 1 (D) p p q – - 1 1 2
p 2 ( ) ( ) — p 35. What is the value of x x dx – 3 sin
0
(A) -1 (B) 0 (C) 1 (D) p
36. Let P(x) and Q(x) be arbitrary predicates. Which of the following statements is
always TRUE?
37. Consider the non-deterministic finite automation (NFA) shown in the figure. State X is the starting state of the automaton. Let the language accepted by the NFA with Y as the only accepting state be L1. Similarly, let the language accepted by the NFA with Z as the only accepting state be L2. Which of the following statements about L1 and L2 is TRUE?
38. Let P be a non-deterministic pushdown automaton (NPDA) with exactly one state, q, and exactly one symbol, Z, in its stack alphabet. State q is both the starting as well as the accepting state of the PDA. The stack is initialized with one Z before S the start of the operation of the PDA. Let the input alphabet of the PDA be . Let L(P) be the language accepted by the PDA by reading a string and reaching its accepting state. Let N(P) be the language accepted by the PDA by reading a
string and emptying its stack.
Which of the following statements is TRUE?
S S (A) L(P) is necessarily * but N(P) is not necessarily *
S S (B) N(P) is necessarily * but L(P) is not necessarily *
S (C) Both L(P) and N(P) is necessarily *
S (D) Neither L(P) nor N(P) are necessarily *
39. Consider the regular grammar:
S Xa Ya
X Za
Z S a B
Y Wa
W Sa
{ } a Where S is the starting symbol, the set of terminals is and the set of non-
{ } S W X Y Z terminals is , , , , .
We wish to construct a deterministic finite automaton (DFA) to recognize the same language. What is the minimum number of states required for the DFA?
(A) 2 (B) 3 (C) 4 (D) 5
40. A language L satisfies the Pumping Lemma for regular languages, and also the Pumping Lemma for context free languages. Which of the following statements
about L is TRUE?
(A) L is necessarily a regular language
(B) L is necessarily a context free language, but not necessarily a regular
language
(C) L is necessarily a non-regular language
(D) None of the above
41. Given below is a program which when executed spawns two concurrent
processes:
Semaphore X:=0;
/* Process now forks into concurrent processes P1 & P2 */
P1 : repeat forever P2 : repeat forever
V(X); P(X);
Compute; Compute;
P(X); V(X);
Consider the following statements about processes P1 and P2:
I: It is possible for process P1 to starve.
II. It is possible for process P2 to starve.
Which of the following holds?
(A) Both I and II are true (B) I is true but II is false
(C) II is true but I is false (D) Both I and II are false
42. Two concurrent processes P1 and P2 use four shared resources R1, R2, R3 and R4, as shown below.
P1: P2:
Compute; Compute;
Use R1; Use R1;
Use R2; Use R2;
Use R3; Use R3;
Use R4; Use R4;
Both processes are started at the same time, and each resource an be accessed by only one process at a time. The following scheduling constraints exist between the access of resources by the processes:
P2 must complete use of R1 before P1 gets access to R1.
P1 must complete use of R2 before P2 gets access to R2.
P2 must complete use of R3 before P1 gets access to R3.
P1 must complete use of R4 before P2 gets access to R4.
There are no other scheduling constraints between the processes. If only binary
semaphores are used to enforce the above scheduling constraints, what is the
minimum number of binary semaphores needed?
(A) 1 (B) 2 (C) 3 (D) 4
43. Which of the following input sequences will always generate a 1 at the output z at the end of the third cycle?
44. We have two designs D1 and D2 for a synchronous pipeline processor. D1 has 5 pipeline stages with execution times of 3 nsec, 2 nsec, 4 nsec, 2 nsec and 3 nsec while the design D2 has 8 pipeline stages each with 2 nsec execution time. How much time can be saved using design D2 over design D1 for executing 100 instructions?
(A) 214 nsec (B) 202 nsec (C) 86 nsec (D) -200 nsec
45. A hardwired CPU uses 10 control signals S1 to S10 in various time steps T1 to T5
to implement 4 instructions 11 to 14 as shown below.
T1 T2 T3 T4 T5
I1 S1, S3, S5 S2, S4, S6 S1, S7 S10 S3, S8
I2 S1, S3, S5 S8, S9, S10 S5, S6, S7 S6 S10
I3 S1, S3, S5 S7, S8, S10 S2, S6, S9 S10 S1, S3
I4 S1, S3, S5 S2, S6, S7 S5, S10 S6, S9 S10
Which of the following pairs of expressions represent the circuit for generating ( ) Ij Ik Tn + indicates that the control control signals S5 and S10 respectively »signal should be generated in time step Tn if the instruction being executed is
Ij Ik ]. or
(A) S5 = T1 + I2 . T3 & S10 = (I1 + I3) . T4 + (I2 + I4) . T5
(B) S5 = T1 + (I2 + I4) . T3 & S10 = (I1 + I3) . T4 + (I2 + I4) . T5
(C) S5 = T1 + (I2 + I4) . T3 & S10 = (I2 + I3 + I4) . T2 + (I1 + I3) . T4 + (I2
+ I4). T5
(D) S5 = T1 + (I2 + I4) . T3 & S10 = (I2 + I3) . T2 + I4. T3 +(I1 + I3) . T4 +
(I2 + I4) . T5
46. A line L in a circuit is said to have a stuck at 0 fault if the lien permanently has a logic value 0. Similarly a line L in a circuit is said to have a stuck at 1 fault if the line permanently has a logic value 1. a circuit is said to have a multiple stuck at fault if one or more lines have stuck at faults. The total number of distinct
multiple stuck at faults possible in a circuit with N lines is:
(A) 3 (B) 3 1 – (C) (D) 2 1 - 2 N
48. The circuit shown below implements a 2-input NOR gate using two 2-1 MUX (control signal 1 selects the upper input). What are the values of signals x, y and
z?
(A) 1, 0, B (B) 1, 0, A (C) 0, 1, B (D) 0, 1, A
49. An instruction set of a processor has 125 signals which can be divided into 5
groups of mutually exclusive signals as follows:
Group 1: 20 signals, Group 2: 70 signals, Group 3: 2 signals, Group 4: 10
signals, Group 5: 23 signals.
How many bits of the control words can be saved by using vertical
microprogramming over horizontal microprogramming?
(A) 0 (B) 103 (C) 22 (D) 55
50. In a binary tree, for every node the difference between the number of nodes in the left and right subtrees is at most 2. If the height of the tree is h > 0, then the minimum number of nodes in the tree is:
(A) (B) (C) (D) 2 2 1 + 2 1 - 2 h – 1 h – 1 h h
( ) 51. Let T n be a function defined by the recurrence
n ( ) ˜ ’
T n T n = + 2 2 for 2 n = and ÷
«
( )
T 1 1 =
Which of the following statements is TRUE?
( ) ( ) ( ) ( ) (A) T n n = log (B) T n n =
( ) ( ) ( ) ( )
(C) T n n = (D) T n n n = log
52. Let G be a weighted undirected graph and e be an edge with maximum weight in G. Suppose there is a minimum weight spanning tree in G containing the edge e.
Which of the following statements is always TRUE?
(A) There exists a cutest in G having all edges of maximum weight
(B) There exits a cycle in G having all edges of maximum weight
(C) Edge e cannot be contained in a cycle
(D) All edges in G have the same weight
53. The following C function takes two ASCII strings and determines whether one is
an anagram of the other. An anagram of a string s is a string obtained by
permuting the letters in s.
int anagram (char *a, char *b){
int count [128], j;
for (j = 0; j < 128; j++) count[j]=0;
j = 0;
while (a[j] && b[j]){
A;
B;
}
for (j = 0; j < 128; j++) if (count[j]) return 0;
return 1;
}
Choose the correct alternative for statements A and B.
(A) A: count [a[j]]++ and B: count[b[j]]-
(B) A: count [a[j]]++ and B: count[b[j]]++
(C) A: count[a[j++]]++ and B: count[b[j]]-
(D) A: count[a[j]]++ and B: count[b[j++]]-
54. The following C function takes a singly-linked list of integers as a parameter and rearranges the elements of the list. The list is represented as pointer to a structure. The function is called with the list containing the integers 1, 2, 3, 4, 5,
6, 7 in the given order. What will be the contents of the list after the function
completes execution?
struct node (int value; struct node * next;};
void rearrange (struct node *list) {
struct node *p, *q;
int temp;
if (!list C !list ‰ next) return;
p = list; q = list ‰ next;
while (q) {
temp = p ‰ value;
p ‰ value = q ‰ value;
q ‰ value = temp;
p = q ‰ next;
q = p ? p ‰ next; 0;
}
}
(A) 1, 2, 3, 4, 5, 6, 7 (B) 2, 1, 4, 3, 6, 5, 7
(C) 1, 3, 2, 5, 4, 7, 6 (D) 2, 3, 4, 5, 6, 7, 1
55. A binary search tree contains the numbers 1, 2, 3, 4, 5, 6, 7, 8. When the tree is
traversed in pre-order and the values in each node printed out, the sequence of
values obtained is 5, 3, 1, 2, 4, 6, 8, 7. If the tree is traversed in post-order, the
sequence obtained would be
(A) 8, 7, 6, 5, 4, 3, 2, 1 (B) 1, 2, 3, 4, 8, 7, 6, 5
(C) 2, 1, 4, 3, 6, 7, 8, 5 (D) 2, 1, 4, 3, 7, 8, 6, 5
56. Let G be a directed graph whose vertex set is the set of numbers from 1 to 100.
There is an edge from a vertex i to a vertex j iff either j = i + 1 or j = 3i. The
minimum number of edges in a path in G from vertex 1 to vertex 100 is:
(A) 4 (B) 7 (C) 23 (D) 99
57. What is the output printed by the following program?
# include <stdio.h>
int f(int n, int k) {
if (n = = 0) return 0;
else if (n%2) return f(n/2, 2*k) + k;
else return f(n/2, 2*k) œ k;
int main () {
printf(—% d“,f(20,1));
return 0;
(A) 5 (B) 8 (C) 9 (D) 20
58. Let a be an array containing n integers in increasing order. The following
algorithm determines whether there are two distinct numbers in the array whose difference is a specified number S > 0.
i = 0; j =1;
while (j < n) {
if (E) j++;
else if (a[j] œ a[i] ==S) break;
else i++;
}
if (j < n) printf(—yes“) else printf (—no“);
Choose the correct expression for E.
(A) a[j] œ a[i] > S (B) a[j] œ a[i] < S
(C) a[i] œ a[J] < S (D) a[i] œ a[J] > S
59. Let a and b be two sorted arrays containing n integers each, in non-decreasing
order. Let c be a sorted array containing 2n integers obtained by merging the two
arra ys a and b. assuming the arrays are indexed starting from 0, consider the
following four statements.
I. a[i] = b[i] c[2i] = a[i]
II. a[i] = b [i] c[2i] = b[i]
III. a[i] = b[i] c[2i] = a[i]
IV. a[i] = b[i] c[2i] = b[i]
Which of the following is TRUE?
(A) only I and II (B) only I and IV
(C) only II and III (D) only III and IV
60. We wish to schedule three processes P1, P2 and P3 on a uniprocessor system.
The priorities, CPU time requirements and arrival times of the processes are as
shown below.
Process Priority CPU time required Arival time (hh:mm:ss)
P1 10 (highest) 20 sec 00:00:05
P2 9 10 sec 00:00:03
P3 8 (lowest) 15 sec 00:00:00
We have a choice of preemptive or non-preemptive scheduling. In preemptive
scheduling, a late-arriving higher priority process can preempt a currently
running process with lower priority. In non-preemptive scheduling, a late arriving
higher priority process must wait for the currently executing process to complete
before it can be scheduled on the processor.
What are the turnaround times (time from arrival till completion) of P2 using
preemptive and non-preemptive scheduling respectively?
(A) 30 sec, 30 sec (B) 30 sec, 10 sec
(C) 42 sec, 42 sec (D) 30 sec, 42 sec
61. Consider a 2-way set associative cache memory with 4 sets and total 8 cache blocks (0-7) and a main memory with 128 blocks (0-127). What memory blocks will be present in the cache after the following sequence of memory block
references if LRU policy is used for cache block replacement? Assuming that
initially the cache did not have any memory block from the current job?
0 5 3 9 7 0 16 55
(A) 0 3 5 7 16 55 (B) 0 3 5 7 9 16 55 (C) 0 5 7 9 16 55 (D) 3 5 7 9 16 55
62. Two shared resources R R are used by processes and P P . Each process and 1 2 1 2 has a certain priority for accessing each resource. Let T denote the priority of
ij
P for accessing . R A process P can snatch a resource R from process P if T is
i j i k j i k greater than . T
j k
Given the following:
I. T T <
1 1 2 1
II. T T >
1 2 22
III. T T <
1 1 2 1
IV. T T <
1 2 22
Which of the following conditions ensures that P P can never deadlock? and
1 2
(A) I and IV (B) II and III
(C) I and II (D) None of the above
63. In a computer system, four files of size 11050 bytes, 4990 bytes, 5170 bytes and
12640 bytes need to be stored. For storing these files on disk, we can use either
100 byte disk blocks or 200 byte disk blocks (but can‘t mix block sizes). For each
block used to store a file, 4 bytes of bookkeeping information also needs to be
stored on the disk. Thus, the total space used to store a file is the sum of the
space taken to store the file and the space taken to store the bookkeeping
information for the blocks allocated for storing the file. A disk block can store
either bookkeeping information for a file or data from a file, but not both.
What is the total space required for storing the files using 100 byte disk blocks
and 200 byte disk blocks respectively?
(A) 35400 and 35800 bytes (B) 35800 and 35400 bytes
(C) 35600 and 35400 bytes (D) 35400 and 35600 bytes
64. The availability of a complex software is 90% . Its Mean Time Between Failure
(MTBF) is 200 days. Because of the critical nature of the usage, the organization
deploying the software further enhanced it to obtain an availability of 95% . In
the process, the Mean Time To Repair (MTTR) increased by 5 days.
What is the MTBF of the enhanced software?
(A) 205 days (B) 300 days (C) 500 days (D) 700 days
65. To carry out white box testing of a program, its flow cha rt representation is
obtained as shown in the figure below.
For basis path based testing of this program, its cyclomatic complexity is:
(A) 5 (B) 4 (C) 3 (D) 2
66. In a data flow diagram, the segment shown below is identified as having
transaction flow characteristics, with p2 identified as the transaction center
A first level architectural design of this segment will result in a set of process
modules with an associated invocation sequence. The most appropriate
architecture is:
(A) p1 invokes p2, p2 invokes either p3, or p4, or p5
(B) p2 invokes p1, and then invokes p3, or p4 , or p5
(C) A new module Tc is defined to control the transaction flow. This module Tc
fist invokes p1 and then invokes p2. p2 in turn invokes p3, or p4, or p5.
(D) A new module Tc is defined to control the transaction flow. This module Tc
invokes p2. p2 invokes p1, and then invokes p3, or p4, or p5.
67. A company maintains records of sales made by its salespersons and pays them
commission based on each individual‘s total sales made in a year. This data is
maintained in a table with following schema:
salesinfo = (salespersonid, totalsales, commission)
In a certain year, due to better business results, the company decides to further
reward its salespersons by enhancing the commission paid to them as per the
following formula.
If commission < = 50000, enhance it by 2%
If 50000 < commission < = 100000, enhance it by 4%
If commission > 100000, enhance it by 6%
The IT staff has written three different SQL scripts to calculate enhancement for
each slab, each of these scripts is to run as a separate transaction as follows:
T1 Update salesinfo
Set commission = commission * 1.02
Where commission < = 50000;
T2 Update salesinfo
Set commission = commission * 1.04
Where commission > 50000 and commission is <=100000;
T3 Update salesinfo
Set commission = commission * 1.06
Where commission > 100000;
Which of the following options of running these transactions will update the
commission of all salespersons correctly?
(A) Execute T1 followed by T2 followed by T3
(B) Execute T2, followed by T3; T1 running concurrently throughout
(C) Execute T3 followed by T2; T1 running concurrently throughout
(D) Execute T3 followed by T2 followed by T1
68. A table ”student‘ with schema (roll, name, hostel, marks) and another table
”hobby‘ with schema (roll, hobbyname) contains records as shown below.
Table student Table hobby
Roll Name Hostel Marks Roll Hobbyname
1798 Manoj Rathod 7 95 1798 Chess
2154 Soumic Banerjee 5 68 1798 Music
2369 Gumma Reddy 7 86 2154 Music
2581 Pradeep Pendse 6 92 2369 Swimming
2643 Suhas Kulkarni 5 78 2581 Cricket
2711 Nitin Kadam 8 72 2643 Chess
2872 Kiran Vora 5 92 2643 Hockey
2926 Manoj Kunkalikar 5 94 2711 volleyball
2959 Hemant Karkhanis 7 88 2872 Football
3125 Rajesh Doshi 5 82 2926 Cricket
2959 Photography
3125 Music
3125 Chess
The following SQL query is executed on the above tables:
select hostel
from student natural join hobby
where marks > = 75 and roll between 2000 and 3000;
Relations S and H with the same schema as those of these two tables
‘ respectively contain the same information as tuples. A new relation S is
obtained by the following relational algebra operation:
69. In an inventory management system implemented at a trading corporation, there
are several tables designed to hold all the information. Amongst these, the
following two tables hold information on which items are supplied by which
suppliers, and which warehouse keeps which items along with the stock-level of
these items.
Supply = (supplierid, itemcode)
Inventory = (itemcode, warehouse, stocklevel)
For a specific information required by the management, following SQL query has been written.
Select distinct STMP supplierid
From supply as STMP
Where not unique (Select ITMP.supplierid
From Inventory, Supply as ITMP
Where STMP.supplierid = ITMP.supplierid
And ITMP.itemcode = Inventory.itemcode
And Inventory.warehouse = ”Nagpur‘);
For the wa rehouse at Nagpur, this query will find all suppliers who
(A) do not supply any item (B) supply exactly one item
(C) supply one or more items (D) supply two or more items
70. In a schema with attributes A, B, C, D a nd E following set of functional
dependencies are given.
A B
A C
CD E
B D
E A
Which of the following functional dependencies is NOT implied by the above set?
(A) CD ‰ AC (B) BD ‰ CD (C) BC ‰ CD (D) AC ‰ BC
71. A network with CSMA/CD protocol in the MAC layer is running at 1 Gbps over a 1
km cable with no repeaters. The signal speed in the cable is 2 10 × m/sec. The 8
minimum frame size for this network should be
(A) 10000 bits (B) 10000 bytes (C) 5000 bits (D) 5000 bytes
72. A channel has a bit rate of 4 kbps and one-way propagation delay of 20 ms. The
channel uses stop and wait protocol. The transmission time of the
acknowledgement frame is negligible. To get a channel efficiency of at least 50%,
the minimum frame size should be
(A) 80 bytes (B) 80 bits (C) 160 bytes (D) 160 bits
73. On a TCP connection, current congestion window size is Congestion Window = 4
KB. The window size advertised by the received is Advertise Window = 6 KB. The
last byte sent by the sender is LastByteSent = 10240 and the last byte
acknowledged by the receiver is LastByteAcked = 8192. The current window size
at the sender is:
(A) 2048 bytes (B) 4096 bytes (C) 6144 bytes (D) 8192 bytes
74. In a communication network, a packet of length L bits takes link L1 with a
probability of p or link L2 with a probability of p . Link L1 and L2 have bit error
1 2
probability of b and b respectively. The probability that the packet will be
1 2
received without error via either L1 or L2 is:
75. In a TDM medium access control bus LAN, each station is assigned one time slot
per cycle for transmission. Assume that the length of each time slot is the time to
transmit 100 bits plus the end-to-end propagation delay. Assume a propagation
speed of 2 10 m/sec. The length of the LAN is 1 km with a bandwidth of 10 × 8
Mbps. The maximum number of stations that can be allowed in the LAN so that
the throughput of each station can be 2
3 Mbps is:
(A) 3 (B) 5 (C) 10 (D) 20
76. A company has a class C network address of 204.204.204.0. It wishes to have
three subnets, one with 100 hosts and two with 50 hosts each. Which one of the
following options represents a feasible set of subnet address/subnet mask pairs?
(A) 204.204.204.128/255.255.255.192
204.204.204.0/255.255.255.128
204.204.204.64/255.255.255.128
(B) 204.204.204.0/255.255.255.192
204.204.204.192/255.255.255.128
204.204.204.64/255.255.255.128
(C) 204.204.204.128/255.255.255.128
204.204.204.192/255.255.255.192
204.204.204.224/255.255.255.192
(D) 204.204.204.128/255.255.255.128
204.204.204.64/255.255.255.192
204.204.204.0/255.255.255.192
77. Assume that —host1.mydomain.dom“ has an IP address of 145.128.16.8. Which
of the following options would be most appropriate as a subsequence of steps in
performing the reverse lookup of 145.128.16.8? In the following options —NS“ is
an abbreviation of —nameserver“?
(A) Query a NS for the root domain and then NS for the —dom“ domains
(B) Directly query a NS for —dom“ and then a NS for —mydomain.dom“ domains
(C) Query a NS for in-addr.arpa and then a NS for 128.145.in-addr.arpa domains
(D) Directly query a NS for 145.in-addr.arpa and then a NS for 128.145.in-
addr.arpa domains.
78. Consider the following message M = 1010001101. The cyclic redundancy check
(CRC) for this message using the divisor polynomial is: x x x + + + 1 5 4 2
(A) 01110 (B) 01011 (C) 10101 (D) 10110
79. Suppose that two parties A and B wish to setup a common secret key (D-H key)
between themselves using the Diffie-Hellman key exchange technique. They
agree on 7 as the modulus and 3 as the primitive root. Party A chooses 2 and
party B chooses 5 as their respective secrets. Their D-H key is:
(A) 3 (B) 4 (C) 5 (D) 6
80. Given below is an excerpt of an xml specification.
<!DOCTYPE library SYSTEM —library.dtd“>
<Book>
<title> GATE 2005 </title>
<type value = —BROCHURE“/>
<accno>10237623786</accno>
</Book>
<Book>
<type value = —FICTION“/>
<accno>0024154807</accno>
</Book>
Given below are several possible excerpts from —libratry.dtd“. For which excerpt
would the above specification be valid?
(A) <!ELEMENT Book (title+, type, accno)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT type EMPTY>
<!ATTLIST type value (BROCHURE/FICTION/TECHNICAL)>
<!ELEMENT accno (#PCDATA)>
(B) <!ELEMENT Book (title?, type, accno)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT type ATTLIST>
<!ATTLIST type value (BROCHURE/FICTION/TECHNICAL)>
<!ELEMENT accno value (#PCDATA)>
(C) <!ELEMENT Book (title*, type, accno)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT type ATTLIST>
<!ATTLIST type value (BROCHURE/FICTION/TECHNICAL)>
<!ELEMENT accno (#PCDATA)>
(D) <!ELEMENT Book (title?, type, accno)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT type EMPTY>
<!ATTLIST type value (BROCHURE/FICTION/TECHNICAL)>
<!ELEMENT accno (#PCDATA)>
Linked Answer Questions: Q.81a to Q85b Carry Two Marks Each.
Statem ent for Linked Answer Questions 81a and 81b:
A disk has 8 equidistant tracks. The diameters of the innermost and outermost tracks are 1 cm and 8 cm respectively. The innermost track has a storage capacity of 10 MB.
81. What is the total amount of data that can be stored on the disk if it is used (A)
with a drive that rotates it with
(i) Constant Linear Velocity
(ii) Constant Angular Velocity
(A) (i) 80 MB (ii) 2040 MB (B) (i) 2040 MB (ii) 80 MB
(C) (i) 80 MB (ii) 360 MB (D) (i) 360 MB (ii) 80 MB
If the disk has 20 sectors per track and is currently at the end of the 5 (B) th
sector of the inner most track and the head can move at a speed of 10
meters/sec and it is rotating at constant angular velocity of 6000 RPM, how
much time will it take to read 1 MB contiguous data starting from the sector
4 of the outer most track?
(A) 13.5 ms (B) 10 ms (C) 9.5 ms (D) 20 ms
Statem ent for Linked Answer Questions 82a and 82b:
A database table T1 has 2000 records and occupies 80 disk blocks. Another table T2 has 400 records and occupies 20 disk blocks. These two tables have to be joined as per a specified join condition that needs to be evaluated for every pair of records from these two tables. The memory buffer space available can hold exactly one block of records for T1 and one block of records for T2 simultaneously at any point in time. No index is
available on either table.
82. If Nested loop join algorithm is employed to perform the join, with the most (A)
appropriate choice of table to be used in outer loop, the number of block
accesses required for reading the data are:
(A) 800000 (B) 40080 (C) 32020 (D) 100
If, instead of Nested loop join, Block nested loop join is used, again with the (B)
most appropriate choice of table in the outer loop, the reduction in number of block accesses required for reading the data will be:
(A) 0 (B) 30400 (C) 38400 (D) 798400
Statem ent for Linked Answer Questions 83a and 83b:
Consider the context-free grammar
E E E +
( ) * E E E
E id
{ } ( ) Where E is the starting symbol, the set of terminals is , , , , * , and the set of id +
{ } non-terminals is . E
83. Which of the following terminal strings has more than one parse tree when (A)
parsed according to the above grammar?
(A) id + id + id + id (B) id + (id* (id * id))
(C) (id * (id*id)) + id (D) ((id * id + id) * id)
For the terminal string with more than one parse tree obtained as solution to (B)
Question 83a, how many parse trees are possible?
(A) 5 (B) 4 (C) 3 (D) 2
Statem ent for Linked Answer Questions 84a and 84b:
A sink in a directed graph is a vertex such that there is an edge from every vertex i to and there is no edge from to any other vertex. A directed graph G with n j i i i vertices is represented by its adjacency matrix a, where 1 » ÿ» ÿ A i j = / / if there is an edge
directed from vertex to and 0 otherwise. The following algorithm determines whether i j
there is a sink in the graph G.
i = 0;
do {
j=i+1;
while((j<n) && E )j++;
1
if (j<n)E ;
2
} while (j<n)
flag =1;
for(j=0;j<n;j++)
if (j!=i)&&E ) flag =0;
3
if(flag) printf(—Sink exists“) else printf(—Sink does not exist“);
84. Choose the correct expressions for and (A) E E
1 2
(A) : and : ; » ÿ» ÿ :! and : 1; » ÿ» ÿ E A i j E i j = E A i j E i j = + / / (B) / /
1 2 1 2
(C) :! and : ; » ÿ» ÿ : and : 1; » ÿ» ÿ E A i j E i j = E A i j E i j = + / / (D) / /
1 2 1 2
Choose the correct expression for (B) E
3
( ) ( )
(A) &&! ! &&! » ÿ» ÿ » ÿ» ÿ » ÿ» ÿ » ÿ» ÿ A i j A j i A i j A j i / / / / (B) / / / /
( ) ( )
(C) ! ! (D) ! » ÿ» ÿ » ÿ» ÿ » ÿ» ÿ » ÿ» ÿ A i j A j i C A i j A j i C / / / / / / / /
Statem ent for Linked Answer Questions 85a and 85b:
Consider a simple graph with unit edge costs. Each node in the graph represents a router. Each node maintains a routing table indicating the next hop router to be used to relay a packet to its destination and the cost of the path to the destination through that router. Initially, the routing table is empty. The routing table is synchronously updated as follows. In each updation interval, three tasks are performed.
(i) A node determines whether its neighbours in the graph are accessible. If so, it sets the tentative cost to each accessible neighbour as 1. Otherwise, the
cost is set to . 8
(ii) From each accessible neighbour, it gets the costs to relay to other nodes via
that neighbour (as the next hop)
(iii) Each node updates its routing table based on the information received in the
previous two steps by choosing the minimum cost.
85. For the graph given above, possible routing tables for various nodes after (A)
they have stabilized, are shown in the following options. Identify the correct
table?
(A) Table for node A (B) Table for node C
A – - A A 1
B B 1 B B 1
C – - C C 1
D B 3 D D 1
E C 3 E E 1
F C 4 F E 3
(C) Table for node B (D) Table for node D
A A 1 A B 3
B – - B B 1
C C 1 C C 1
D D 1 D – -
E C 2 E E 1
F D 2 F F 1
Continuing from the earlier problem, suppose at some time t, when the costs (B)
have stabilized, node A goes down. The cost from node F to node A at time
( ) 100 is: t +
(A) > 100 but finite (B) (C) 3 (D) >3 and 100 8 =