Gate IT 2005
Question 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
1/36  
1/6  
1/4  
1/3 
Discuss it
Question 1 Explanation:
As number of colors is 3,Possible combinations > 3! = 6
Probability of Blue marble: 10/60
Probability of Green marble: 20/60
Probability of Red marble: 30/60
Probability that no two of the marbles drawn have the same colour is = 6 * (10/60 * 20/60 * 30/60) = 1/6
Therefore B is the Answer
Question 2 
If the trapezoidal method is used to evaluate the integral obtained _{0}∫^{1}x^{2}dx ,then the value obtained
is always > (1/3)  
is always < (1/3)  
is always = (1/3)  
may be greater or lesser than (1/3) 
Discuss it
Question 3 
1  
0  
1  
2 
Discuss it
Question 3 Explanation:
Matrices don’t have value associated with them, but determinant have value associated with them. Determinant of a matrix can be find out by taking any one row or one column, in this row or column, multiplying each element with its cofactor and summing the value up.
This solution is contributed by Sandeep Pandey.
Question 4 
Let L be a regular language and M be a contextfree language, both over the alphabet Σ. Let Lc and Mc denote the complements of L and M respectively. Which of the following statements about the language Lc∪ Mc is TRUE
It is necessarily regular but not necessarily contextfree  
It is necessarily contextfree.  
It is necessarily nonregular.  
None of the above 
Discuss it
Question 4 Explanation:
Proposition:
L is a regular language
M is a context free language
Derivation:
L_c union M_c = complement{L intersection M}
Now, L intersection M is a CFL according to closure laws of CFLs, i.e. intersection of a CFL with RL is always a CFL.
But, complement{L intersection M} might not be a CFL because complement over CFL doesn't guarantee a CFL. It can even be a RL or it might even lie outside the CFL circle. It will be a contextsensitive language certainly, but nothing else can be said about it.
Conclusion:
Considering the above derivation, none of the statements are true. Hence correct answer would be (D) None of the above.
Related article :
http://quiz.geeksforgeeks.org/theoryofcomputationclosurepropertiesofcontextfreelanguages/
This solution is contributed by Vineet Purswani.
Question 5 
Which of the following statements is TRUE about the regular expression 01*0?
It represents a finite set of finite strings.  
It represents an infinite set of finite strings.  
It represents a finite set of infinite strings.  
It represents an infinite set of infinite strings 
Discuss it
Question 5 Explanation:
First of all, A string can never be infinite because String is a finite sequence of symbols over Σ
So option (c) and (d) are eliminated.
And because of star(*) it can generate infinite set.
So Option (B) is CORRECT.
This solution is contributed by Abhishek Agrawal.
Question 6 
The language {0^{n} 1^{n} 2^{n}  1 ≤ n ≤ 10^{6}} is
regular  
contextfree but not regular.  
contextfree but its complement is not contextfree.  
not contextfree 
Discuss it
Question 6 Explanation:
The value of ‘n’ is finite. So, only finite number of strings can be part of given language. Therefore, we can construct a finite state automata for this language.
Thus, option (A) is correct.
Please comment below if you find anything wrong in the above post.
Question 7 
Which of the following expressions is equivalent to (A⊕B)⊕C
(A+B+C)(A¯+B¯+C¯)  
(A+B+C)(A¯+B¯+C)  
ABC+A¯(B⊕C)+B¯(A⊕C)  
None 
Discuss it
Question 7 Explanation:
(A ⊕ B) ⊕ C By Solving, We get = (A ⊕ B)′ C + (A ⊕ B) C′ The above expression can be written as: = (A ⊙ B) C + (A ⊕ B) C′ Now, = (AB + A′B′) C + (A ⊕ B) C′ = ABC + A′B′C + AB′C′ + A′BC′ [As: X + X = X] [So, A′B′C + A′B′C = A′B′C] = ABC + (A′B′C + A′B′C) + AB′C′ + A′BC′ This can be written as: = ABC + A′ (B ⊕ C) + B′ (A ⊕ C)This explanation has been provided by Saksham Seth.
Question 8 
Using Booth's Algorithm for multiplication, the multiplier 57 will be recoded as
0 1 0 0 1 0 0 1  
1 1 0 0 0 1 1 1  
0 1 0 0 1 0 0 0
(A+B+C)(A¯+B¯+C)
ABC+A¯(B⊕C)+B¯(A⊕C)  
0 1 0 0 1 0 0 1 
Discuss it
Question 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?
10  
6.4  
1  
.64 
Discuss it
Question 9 Explanation:
Memory cycle time = 64 ns Memory is refreshed 100 times per msec.
Number of refreshes in 1 memory cycle (i.e in 64 ns) = (100 * 64 * 10^{9}) / 10^{3} = 64 * 10^{4}.
Time taken for each refresh = 100 ns Time taken for 64 * 10^{4} refreshes = 64 * 10^{4} * 100 * 10^{9} sec = 64 * 10^{11} sec.
Percentage of the memory cycle time used for refreshing : = (Time taken to refresh in 1 memory cycle / Total time) * 100 = (64 * 10^{11} / 64 * 10^{9}) * 100 = 1 %
Thus, option (C) is correct.
Please comment below if you find anything wrong in the above post.
Question 10 
A twoway 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 twoway 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 ?
S1.S2'  
S1+S2  
(S1⊕S2)'  
S1⊕S2 
Discuss it
Question 10 Explanation:
If we draw truth table of the above circuit,it'll be
S1 S2 Bulb
0 0 On
0 1 Off
1 0 Off
1 1 On
= (S1⊕ S2)'
Therefore answer is C
Question 11 
How many pulses are needed to change the contents of a 8bit up counter from 10101100 to 00100111 (rightmost bit is the LSB)?
134  
133  
124  
123 
Discuss it
Question 11 Explanation:
8 bit Counter range 0255
To go from 10101100 (172) to 00100111 (39)
 first counter will move from 172 to 255(255172=83)
 255 to 0=1 pulse
 and then 0 to 39(390=39).
Question 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
p  
p + 1  
n  p  
n  p + 1 
Discuss it
Question 12 Explanation:
Binary Search Tree, is a nodebased binary tree data structure which has the following properties:
 The left subtree of a node contains only nodes with keys less than the node’s key.
 The right subtree of a node contains only nodes with keys greater than the node’s key.
 The left and right subtree each must also be a binary search tree. There must be no duplicate nodes.
So let us say n=10, p=4. According to BST property the root must be 104=6 (considering all unique elements in BST)
And according to BST insertion, root is the first element to be inserted in a BST.
Therefore, the answer is (np).
Question 13 
A function f defined on stacks of integers satisfies the following properties. f(∅) = 0 and f (push (S, i)) = max (f(S), 0) + i 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)?6  
4  
3  
2 
Discuss it
Question 13 Explanation:
f(S) = 0, max(f(S), 0) = 0, i = 2 f(S)_{new} = max(f(S), 0) + i = 0 + 2 = 2
f(S) = 2, max(f(S), 0) = 2, i = 3 f(S)_{new} = max(f(S), 0) + i = 2  3 = 1
f(S) = 1, max(f(S), 0) = 0, i = 2 f(S)_{new} = max(f(S), 0) + i = 0 + 2 = 2
f(S) = 2, max(f(S), 0) = 2, i = 1 f(S)_{new} = max(f(S), 0) + i = 2  1 = 1
f(S) = 1, max(f(S), 0) = 1, i = 2 f(S)_{new} = max(f(S), 0) + i = 1 + 2 = 3
Thus, option (C) is correct.
Please comment below if you find anything wrong in the above post.
Question 14 
In a depthfirst traversal of a graph G with n vertices, k edges are marked as tree edges. The number of connected components in G is
k  
k + 1  
n  k  1  
n  k 
Discuss it
Question 14 Explanation:
Tree edges are the edges that are part of DFS tree. If there are x tree edges in a tree, then x+1 vertices in the tree.
The output of DFS is a forest if the graph is disconnected. Let us see below simple example where graph is disconnected.
The above example matches with D option
More Examples:
1) All vertices of Graph are connected. k must be n1. We get number of connected components = n k = n  (n1) = 1
2) No vertex is connected. k must be 0. We get number of connected components = n k = n  0 = n
Question 15 
In the following table, the left column contains the names of standard graph algorithms and the right column contains the time complexities of the algorithms. Match each algorithm with its time complexity.
1. BellmanFord algorithm 2. Kruskal’s algorithm 3. FloydWarshall algorithm 4. Topological sorting  A : O ( m log n) B : O (n^{3}) C : O (nm) D : O (n + m) 
1→ C, 2 → A, 3 → B, 4 → D  
1→ B, 2 → D, 3 → C, 4 → A  
1→ C, 2 → D, 3 → A, 4 → B  
1→ B, 2 → A, 3 → C, 4 → D 
Discuss it
Question 15 Explanation:
 BellmanFord algorithm: Time complexity: O(VE)
 Kruskal’s algorithm:Time Complexity: O(ElogE) or O(ElogV). Sorting of edges takes O(ELogE) time. After sorting, we iterate through all edges and apply findunion algorithm. The find and union operations can take atmost O(LogV) time. So overall complexity is O(ELogE + ELogV) time. The value of E can be atmost V^2, so O(LogV) are O(LogE) same. Therefore, overall time complexity is O(ElogE) or O(ElogV)
 FloydWarshall algorithm: Time Complexity: O(V^3)
 Topological sorting: Time Complexity: The above algorithm is simply DFS with an extra stack. So time complexity is same as DFS which is O(V+E).
Question 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?
2  
3  
4  
6 
Discuss it
Question 16 Explanation:
43>3
165>5
62>2
123> 3(occupied) So acc to linear probing 3+1=4
142 >2(occupied),3(occupied),4 (occupied) ,5 (occupied) >6
Therefore correct Answer D
Question 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 3Which of the following types of information would be lost from her file system? (I) Hobbies (II) Friends (III) Courses
(I) and (II) only  
(II) and (III) only  
(II) only  
(I) and (III) only 
Discuss it
Question 18 
The shell command
find name passwd printis 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?
ls passwd  
cat passwd  
grep name passwd  
grep print passwd 
Discuss it
Question 18 Explanation:
Find is a Unix (or Linux) command used for searching the files in a directory hierarchy. The syntax of find command is :
find –name “filename” –print
Grep is a unix command which can be used to find file names with a watching string. The syntax of grep command is :
grep name “filename”
Thus, option (C) is correct.
Please comment below if you find anything wrong in the above post.
Question 19 
A user level process in Unix traps the signal sent on a CtrlC input, and has a signal handling routine that saves appropriate files before terminating the process. When a CtrlC input is given to this process, what is the mode in which the signal handling routine executes?
kernel mode  
superuser mode  
privileged mode  
user mode 
Discuss it
Question 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 is FALSE in this context.
The relationship between FP and LOC depends on the programming language used to implement the software.  
LOC requirement for an assembly language implementation will be more for a given FP value, than LOC for implementation in COBOL  
On an average, one LOC of C++ provides approximately 1.6 times the functionality of a single LOC of FORTRAN  
FP and LOC are not related to each other 
Discuss it
Question 20 Explanation:
As language levels go up, fewer statements to code one Function Point are required.
For example, COBOL may requires about 105 statements per Function Point and php only 67.
Question 21 
Consider the entities 'hotel room', and 'person' with a many to many relationship 'lodging' as shown below:
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
Person  
Hotel Room  
Lodging  
None of these 
Discuss it
Question 21 Explanation:
Lodging is the only attribute relating person and hotel room.
Question 22 
A table has fields Fl, F2, F3, F4, F5 with the following functional dependencies
F1 → F3 F2→ F4 (F1 . F2) → F5
In terms of Normalization, this table is in
1 NF  
2 NF  
3 NF  
none 
Discuss it
Question 22 Explanation:
First Normal Form
A relation is in first normal form if every attribute in that relation is singled valued attribute.
Second Normal Form
A relation is in 2NF iff it has No Partial Dependency, i.e., no nonprime attribute (attributes which are not part of any candidate key) is dependent on any proper subset of any candidate key of the table.
This table has Partial Dependency f1>f3, f2> f4 given (F1,F2) is Key
So answer is A
Question 23 
A BTree 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 are:
5  
4  
3  
2 
Discuss it
Question 23 Explanation:
Number of children of a node is equal to the number of keys in it plus 1.
Given tree has 4 levels, the tree will be increased with one more level if a new key is inserted.
Question 24 
Amongst the ACID properties of a transaction, the 'Durability' property requires that the changes made to the database by a successful transaction persist
Except in case of an Operating System crash  
Except in case of a Disk crash  
Except in case of a power failure  
Always, even if there is a failure of any kind 
Discuss it
Question 24 Explanation:
ACID properties:
Atomicity: By this, we mean that either the entire transaction takes place at once or doesn’t happen at all.
Consistency: This means that integrity constraints must be maintained so that the database is consistent before and after the transaction.
Isolation: This property ensures that multiple transactions can occur concurrently without leading to inconsistency of database state.
Durability: This property ensures that once the transaction has completed execution, the updates and modifications to the database are stored in and written to disk and they persist even if system failure occurs no matter which type of failure.
Therefore option D
Question 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?
HTTP, SMTP, FTP  
FTP, HTTP, SMTP  
HTTP, FTP, SMTP  
SMTP, HTTP, FTP 
Discuss it
Question 25 Explanation:
PROMPT Toggles prompting. Ftp prompts during multiple file transfers to allow you to selectively retrieve or store files //Used for FTP transfers
HEAD The <head> element can include a title for the document, scripts, styles, meta information, and more //Used in HTML to transfer data across HTTP protocol
RCPT You tell the mail server who the recipient of your message is by using the RCPT command //Related to mail so,SMTP
Question 26 
Traceroute 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 traceroute to identify these hosts
By progressively querying routers about the next router on the path to B using ICMP packets, starting with the first router  
By requiring each router to append the address to the ICMP packet as it is forwarded to B. The list of all routers enroute to B is returned by B in an ICMP reply packet  
By ensuring that an ICMP reply packet is returned to A by each router enroute to B, in the ascending order of their hop distance from A  
By locally computing the shortest path from A to B 
Discuss it
Question 26 Explanation:
traceroute tracks the route packets taken from an IP network on their way to a given host. It utilizes the IP protocol's time to live (TTL) field and attempts to elicit an ICMP TIME_EXCEEDED response from each gateway along the path to the host.
Question 27 
Which of the following statements is TRUE about CSMA/CD
IEEE 802.11 wireless LAN runs CSMA/CD protocol  
Ethernet is not based on CSMA/CD protocol  
CSMA/CD is not suitable for a high propagation delay network like satellite network  
There is no contention in a CSMA/CD network 
Discuss it
Question 27 Explanation:
CSMA/CD requires that sender should be transmitting at least till the first bit reaches the receiver, so it can detect collision if any. For Networks with high prorogation delay this time becomes too long hence the minimum packet size required becomes too big to be feasible.
Question 28 
Count to infinity is a problem associated with
link state routing protocol.  
distance vector routing protocol  
DNS while resolving host name.  
TCP for congestion control. 
Discuss it
Question 28 Explanation:
Networks using distancevector routing are susceptible to loops and issues with count to infinity. Problems can happen with your routing protocol when a link or a router fails.
Question 29 
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.
Only GET  
Only POST  
Either of GET or POST  
Neither GET nor POST 
Discuss it
Question 29 Explanation:
Reasons:
GET is NOT SECURE, whatever data you transfer is goes as part of URI and that's why it's visible to whole world, you can not send any confidential data using this method.
POST sends data as part of HTTP request body, which can be encrypted using SSL and TLS. This is the reason all confidential data from client to server transffered using POST method e.g. username and password when you login to internet banking, or any online portal.
Read more at: http://java67.blogspot.com/2014/08/differencebetweenpostandgetrequest.html#ixzz3v2Sjr66R
Question 30 
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?
g is onto => h is onto  
h is onto => f is onto  
h is onto => g is onto  
h is onto => f and g are onto 
Discuss it
Question 31 
Which of the following statements is FALSE regarding a bridge?
Bridge is a layer 2 device  
Bridge reduces collision domain  
Bridge is used to connect two or more LAN segments  
Bridge reduces broadcast domain 
Discuss it
Question 31 Explanation:
 Bridge is a layer 2 device TRUE //A device used to connect two separate Ethernet networks into one extended Ethernet and Ethernet works on DATA LINK Layer
 Bridge reduces collision domainTRUE//A bridge is a two interfaces device that creates 2 collision domains, since it forwards the traffic it receives from one interface only to the interface where the destination layer 2 device (based on his mac address) is connected to.
 Bridge is used to connect two or more LAN segments TRUE // It is its sole purpose
 Bridge reduces broadcast domain FALSE //Bridge can reduce collision domain but can NOT reduce broadcast domain
Question 32 
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
3  
4  
5  
6 
Discuss it
Question 33 
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_{1} and S_{2} in C, either S_{1 }⊂ S_{2} or S_{2}⊂ S_{1}. What is the maximum cardinality of C?
n  
n + 1  
2n1 + 1  
n! 
Discuss it
Question 33 Explanation:
As i already mentioned, even if there is small scope of getting solution by substitution method, Just go for it...!!
Here let n=2 A = {1, 2}
All subsets formed by A are:  {}, {1}, {2}, {1,2}.
C is a collection of distinct subsets such that for any S1, S2 either S1⊂S2 or S2⊂S1.
So for C, {} null set can be included always since it null. set is a subset of every set.
We can choose one from either {1} or {2}, {1,2} can be included to maximise the cardinality.
So, here 1) If {1} is chosen then C = {}, {1}, {1,2} here every set is subset of other.
2) If {2} is chosen then C = {}, {2}, {1,2} here also every set is subset of other.
So, answer should be 2 but it incluedes empty set also therefore the maximum cardinality of C is 3.
This solution is contributed by Anil Saikrishna Devarasetty .
Question 34 
Let n = p^{2}q, where p and q are distinct prime numbers. How many numbers m satisfy 1 ≤ m ≤ n and gcd (m, n) = 1? Note that gcd (m, n) is the greatest common divisor of m and n.
p(q  1)  
pq  
(p2 1) (q  1)  
p(p  1) (q  1) 
Discuss it
Question 36 
Let P(x) and Q(x) be arbitrary predicates. Which of the following statements is always TRUE?
((∀x(P(x)∨Q(x))))⟹((∀xP(x))∨(∀xQ(x)))  
(∀x(P(x)⟹Q(x)))⟹((∀xP(x))⟹(∀xQ(x)))  
(∀x(P(x))⟹∀x(Q(x)))⟹(∀x(P(x)⟹Q(x)))  
(∀x(P(x))⇔(∀x(Q(x))))⟹(∀x(P(x)⇔Q(x))) 
Discuss it
Question 36 Explanation:
Generally, these type of questions can be solved by using two statements and checking the validity of each and every option.
Here, let the statements be P and Q where,
P : Student is a girl
Q : Student is smart
Option B says that, IF for all student x : If x is a girl then the student is smart THEN IF the whole class comprises of girls then the whole class comprises of smart students.
This solution is contributed by Anil Saikrishna Devarasetty.
Question 37 
Consider the nondeterministic finite automaton (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?
Correction in Question: There is an edge from Z>Y labeled 0 and another edge from Y>Z labeled 1  in place of double arrowed and no arrowed edges.
L1 = L2  
L1 ⊂ L2
 
L2 ⊂ L1  
None of the above 
Discuss it
Question 37 Explanation:
A generic approach to solve such questions would be to come up with the corresponding regular languages and compare the two. Ardens theorem could be used to achieve the objective. Moreover, some conclusions could be drawn without even deriving the languages completely, solely from the intermediary equations. Constructing equations for every state : X = Z0 +X1, Y = X0 +Y0 +Z0 && Z = X0 + Y1 + Z1. Clearly, regular languages L1 and L2 couldn’t be same.
Now, to check which of the other three options are correct, we need to find :
1) a string which is accepted by L1 but not by L2.
2) a string which is accepted by L2 but not by L1. If there exists string 1) but not 2) then L2 ⊂ L1 and likewise.
Trying our hands at the given DFA,
1) string 00 is accepted by L1 but not by L2 and
2) string 01 is accepted by L2 but not by L1. Hence, neither of the two languages our subset of the other.
This solution is contributed by Vineet Purswani.
Another solution.
L1 can have 00 string while L2 can't. L2 can have 01 while L1 can't
None of them can be either equal or proper subset of each other.
So Ans. D.
Question 38 
Let P be a nondeterministic 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 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?
L(P) is necessarily Σ* but N(P) is not necessarily Σ*  
N(P) is necessarily Σ* but L(P) is not necessarily Σ*  
Both L(P) and N(P) are necessarily Σ*  
Neither L(P) nor N(P) are necessarily Σ* 
Discuss it
Question 38 Explanation:
The language L(P) accepted by the Push Down Automata (PDA) by reading string and reaching
its accepting state and the language N(P) accepted by the PDA by reading
a string and emptying a stack but it may be the case that the string has
a dead configuration over the transitions of the PDA i.e. PDA does not have
a transition for a particular alphabet or string. Hence it does not accept
all the strings over Σ*.
For example Transitions for the PDA are as follows: 1. (q, a, Z) > (q, aZ) 2. (q, b, Z) > (q, bZ) 3. (q, a, a) > (q, aa) 4. (q, a, b) > (q, ab) 5. (q, b, a) > (q, ba) 6. (q, null, Z) > (q, Z) 7. (q, null ,a) > (q, null) 8. (q, null, b) > (q, null)Here q is the initial and accepting state, Z is the initial stack symbol and a and b are the input alphabets.Here {null, a, b, ab, aab………..} are accepted in both the cases but in case of “bb” the PDA enters into a dead configuration as no such transition is present. Hence neither L(P) nor N(P) be necessarily Σ*. This explanation has been contributed by Yashika Arora.
Question 39 
Consider the regular grammar:
S → Xa  Ya
X → Za
Z → Sa  ϵ
Y → Wa
W → Sa
where S is the starting symbol, the set of terminals is {a} and the set of nonterminals is {S, W, X, Y, Z}.
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?
2  
3  
4  
5 
Discuss it
Question 39 Explanation:
Language produced by the given grammar is : L = { aa, aaa, aaaaa, aaaaaa, aaaaaaa, aaaaaaaaa ......}
It will not produce strings of length 1, 4, 8 ....
Thus, the minimum string is 'aa'. So, minimum states required to construct automata for this language are 3.
Thus, option (B) is correct.
Please comment below if you find anything wrong in the above post.
Question 40 
A language L satisfies the Pumping Lemma for regular languages, and also the Pumping Lemma for contextfree languages. Which of the following statements about L is TRUE?
L is necessarily a regular language.  
L is necessarily a contextfree language, but not necessarily a regular language  
L is necessarily a nonregular language  
None of the above 
Discuss it
Question 40 Explanation:
Pumping lemma is negativity test. We use it to disprove that a languages is not regular. But reverse is not true.
Question 41 
Given below is a program which when executed spawns two concurrent processes :
semaphore X : = 0 ;
/* Process now forks into concurrent processes P1 & P2 */
Consider the following statements about processes P1 and P2:
P1  P2 

repeat forever V (X) ; Compute ; P(X) ;  repeat forever P(X) ; Compute ; V(X) ; 
 It is possible for process P1 to starve.
 It is possible for process P2 to starve.
Both I and II are true  
I is true but II is false  
II is true but I is false  
Both I and II are false 
Discuss it
Question 41 Explanation:
Starvation occurs when a process is not allowed to enter its critical section.
In process P1, entry section calls function Signal() on semaphore ‘X’. Thus, even when the value of X < = 0, it will increment the value of 'X' and enter critical section.
If the control is in critical section of process P1 then X > = 1. Thus, process P2 will decrement the value of X by calling function Wait() on semaphore ‘X’ and enter its critical section.
So, process P1 and P2 will never starve.
Thus, option (D) is correct.
Please comment below if you find anything wrong in the above post.
Question 42 
Two concurrent processes P1 and P2 use four shared resources R1, R2, R3 and R4, as shown below.
Both processes are started at the same time, and each resource can be accessed by only one process at a time The following scheduling constraints exist between the access of resources by the processes:
P1  P2 

Compute: Use R1; Use R2; Use R3; Use R4;  Compute; Use R1; Use R2; Use R3;. Use R4; 
 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.
1  
2  
3  
4 
Discuss it
Question 42 Explanation:
We use two semaphores : A and B. A is initialized to 0 and B is initialized to 1.
P1:
Compute; Wait(A); Use R1; Use R2; Signal(B); Wait(A); Use R3; Use R4; Signal(B);
P2:
Compute; Wait(B); Use r1; Signal(A); Wait(B); Use R2; Use R3; Signal(A); Wait(B); Use R4; Signal(B);
In process p1, initially control will be stuck in while loop of Wait(A) because A = 0. In process p2, Wait(B) decrements the value of B to 0 . Now, P2 uses the resource R1 and increments the value to A to 1 so that process P1 can enter its critical section and use resource R1.
Thus, P2 will complete use of R1 before P1 gets access to R1.
Now, in P2 values of B = 0. So, P2 can not use resource R2 till P1 uses R2 and calls function Signal(B) to increment the value of B to 1. Thus, P1 will complete use of R2 before P2 gets access to R2.
Now, semaphore A = 0. So, P1 can not execute further and gets stuck in while loop of function Wait(A). Process P2 uses R3 and increments the value of semaphore A to 1.Now, P1 can enter its critical section to use R3. Thus, P2 will complete use of R3 before P1 gets access to R3.
Now, P1 will use R4 and increments the value of B to 1 so that P2 can enter is critical section to use R4. Thus, P1 will complete use of R4 before P2 gets access to R4.
Thus, option (B) is correct.
Please comment below if you find anything wrong in the above post.
Question 43 
Which of the following input sequences will always generate a 1 at the output z at the end of the third cycle?
0 0 0
1 0 1
1 1 1  
1 0 1
1 1 0
1 1 1  
0 1 1
1 0 1
1 1 1  
0 0 1
1 1 0
1 1 1 
Discuss it
Question 43 Explanation:
Let's take cycles as 1,2,3. There are two flipflops, let's call them D1 and D2. And Q1, Q2 to be the output for flipflop D1, D2 respectively. here Q11 means output of D1 flipflop for 1st cycle, similarly Q12 is the output of D1 flipflop for 2nd Cycle. A1, A2, A3 means input for A at cycles 1, 2, 3 respectively. Similarly for B and C. Let's check for the option D where: A1=0 A2=1 A3=1 B1=0 B2=1 B3=1 C1=1 C2=0 C3=1 Q11=0 Q12 = A1.B1 = 0.0 = 0 Q13 = A2.B2 = 1.1 = 1 ~Q11=1 ~Q12 = ~(A1.B1) = 1 ~Q13 = ~(A2.B2) = 0 Q21 = 0 Q22 = C1.(~Q11) = 1.1 = 1 Q23 = C2.(~Q12) = 0.1 = 0 Z1 = 0 Z2 = Q12.Q21 = 0.0 = 0 Z3 = Q13.Q22 = 1.1 = 1 Hence, sequence given in option D is generating a 1 at the output z at the end of the third cycle (Z3).This explanation has been contributed by Harshit Sidhwa.
Question 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?
214 nsec  
202 nsec  
86 nsec  
 200 nsec 
Discuss it
Question 44 Explanation:
Total execution time = (k + n – 1) * maximum clock cycle Where k = total number of stages and n = total number of instructions
For D1 : k = 5 and n = 100 Maximum clock cycle = 4ns Total execution time = (5 + 100  1) * 4 = 416
For D2 : k = 8 and n = 100 Each clock cycle = 2ns Total execution time = (8 + 100  1) * 2 = 214
Thus, time saved using D2 over D1 = 416 – 214 =202
Thus, option (B) is correct.
Please comment below if you find anything wrong in the above post.
Question 45 
A hardwired CPU uses 10 control signals S1 to S10, in various time steps T1 to T5, to implement 4 instructions I1 to I4 as shown below:
Which of the following pairs of expressions represent the circuit for generating control signals S5 and S10 respectively?
((Ij+Ik)Tn indicates that the control signal should be generated in time step Tn if the instruction being executed is Ij or lk)
S5=T1+I2⋅T3 and
S10=(I1+I3)⋅T4+(I2+I4)⋅T5  
S5=T1+(I2+I4)⋅T3 and
S10=(I1+I3)⋅T4+(I2+I4)⋅T5  
S5=T1+(I2+I4)⋅T3 and
S10=(I2+I3+I4)⋅T2+(I1+I3)⋅T4+(I2+I4)⋅T5  
S5=T1+(I2+I4)⋅T3 and
S10=(I2+I3)⋅T2+I4⋅T3+(I1+I3)⋅T4+(I2+I4)⋅T5 
Discuss it
Question 46 
A line L in a circuit is said to have a stuckat0 fault if the line permanently has a logic value 0. Similarly a line L in a circuit is said to have a stuckat1 fault if the line permanently has a logic value 1. A circuit is said to have a multiple stuckat fault if one or more lines have stuck at faults. The total number of distinct multiple stuckat faults possible in a circuit with N lines is
3^N  
3^N  1  
2^N  1  
2 
Discuss it
Question 46 Explanation:
In a line, there can be three possibilities : 1. Stuckat 0 fault 2. Stuckat 1 fault 3. No fault
Thus, total combinations = 3^{N}
It is mentioned that one or more lines have stuck at faults. So, a case in which there is no fault in any line i.e. all lines are correct can not occur. Total combinations = 3^{N}  1
Thus, option (B) is correct.
Please comment below if you find anything wrong in the above post.
Question 47 
(34.4)_{8} × (23.4)_{8} evaluates to
A)  (1053.6)_{8} 
B)  (1053.2)_{8} 
C)  (1024.2)_{8} 
D) 
None of these 
Discuss it
Question 47 Explanation:
We convert (34.4)_{8} to decimal. = 3 * 8^{1} + 4 * 8^{0} + 4 * 8^{1} = 3 * 8 + 4 + 0.5 = (28.5)_{10}
We covert (23.4)_{8} to decimal. = 2 * 8^{1} + 3 * 8^{0} + 4 * 8^{1} = 2 * 8 + 3 + 0.5 = (19.5)_{10}
Now, (28.5)_{10} * (19.5)_{10} = (555.75)_{10}
We convert (555.5)_{10} to octal. 555 / 8 = 69 , 555 % 8 = 3 69 / 8 = 8 , 69 % 8 = 5 8 / 8 = 1 , 8 % 8 = 0 1 / 8 = 0 , 1 % 8 = 1
We keep multiplying the decimal part by 8 till it becomes 0. 0.75 * 8 = 6.0
Thus, (555.75)_{10} = (1053.6)_{8}
Thus, option (A) is correct.
Please comment below if you find anything wrong in the above post.
Question 48 
The circuit shown below implements a 2input NOR gate using two 24 MUX (control signal 1 selects the upper input). What are the values of signals x, y and z?
1, 0, B  
1, 0, A  
0, 1, B  
0, 1, A 
Discuss it
Question 48 Explanation:
In MUX1, equation is : g = Az + Bz’ In MUX2, equation is : f = xg + yg’ = x(Az + Bz’) + y (Az + Bz’)’
Function ‘f’ should be equal to (A + B)’ .
Using hit and try method, put x = 0, y = 1 and z = A. f = 0(AA + BA’) + 1(AA + BA’)’ f = (A + A’B)’ f = (A + B)’
Thus, option (D) is correct.
Please comment below if you find anything wrong in the above post.
Question 49 
n 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?
0  
103  
22  
55 
Discuss it
Question 49 Explanation:
In horizontal microprogramming, each control signal is represented by one bit in the microinstruction. Therefore, total number of bits of the control words required in Horizontal microprogramming : = 20 + 70 + 2 + 10 + 23 = 125 bits
In vertical microprogramming, 'n' control signals encoded into log_{2} n bits. group 1 : log_{2} 20 = 5 bits group 2 : log_{2} 70 = 7 bits group 3 : log_{2} 2 = 1 bits group 4 : log_{2} 10 = 4 bits group 5 : log_{2} 23 = 5 bits
Total number of bits required in vertical microprogramming = 5 + 7 + 1 + 4 + 5 = 22 bits
So, number of bits saved= 125  22 = 103 bits.
Thus, option (B) is correct.
Please comment below if you find anything wrong in the above post.
Question 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:
2^{h  1}  
2^{h  1} + 1  
2^{h}  1  
2^{h} 
Discuss it
Question 50 Explanation:
Let there be n(h) nodes at height h. In a perfect tree where every node has exactly two children, except leaves, following recurrence holds. n(h) = 2*n(h1) + 1 In given case, the numbers of nodes are two less, therefore n(h) = 2*n(h1) + 1  2 = 2*n(h1)  1 Now if try all options, only option (b) satisfies above recurrence. Let us see option (B) n(h) = 2^{h  1} + 1 So if we substitute n(h1) = 2^{h2} + 1, we should get n(h) = 2^{h1} + 1 n(h) = 2*n(h1)  1 = 2*(2^{h2} + 1) 1 = 2^{h1} + 1.
Question 51 
Let T(n) be a function defined by the recurrence
T(n) = 2T(n/2) + √n for n ≥ 2 and
T(1) = 1
Which of the following statements is TRUE?
T(n) = θ(log n)  
T(n) = θ(√n)  
T(n) = θ(n)  
T(n) = θ(n log n) 
Discuss it
Question 51 Explanation:
n^{(logba)} = n which is = n^(1.5) = O(sqrt n)
then by applying case 1 of master method we get T(n) = Θ(n)
Please refer http://www.geeksforgeeks.org/analysisalgorithmset4mastermethodsolvingrecurrences/ for more details.
Question 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?
There exists a cutset in G having all edges of maximum weight.  
There exists a cycle in G having all edges of maximum weight  
Edge e cannot be contained in a cycle.  
All edges in G have the same weight 
Discuss it
Question 52 Explanation:
Background : Given a connected and undirected graph, a spanning tree of that graph is a subgraph that is a tree and connects all the vertices together.
 A spanning tree has exactly V  1 edges.
 A single graph can have many different spanning trees. A minimum spanning tree (MST) or minimum weight spanning tree for a weighted, connected and undirected graph is a spanning tree with weight less than or equal to the weight of every other spanning tree. The weight of a spanning tree is the sum of weights given to each edge of the spanning tree.
 There can be more that one possible spanning trees of a graph. For example, the graph in this question has 6 possible spanning trees.
 MST has lightest edge of every cutset. Remember Prim's algorithm which basically picks the lightest edge from every cutset.
Question 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 : count [a[j]]++ and B : count[b[j]]  
A : count [a[j]]++ and B : count[b[j]]++  
A : count [a[j++]]++ and B : count[b[j]]  
A : count [a[j]]++and B : count[b[j++]] 
Discuss it
Question 53 Explanation:
1
Question 54 
The following C function takes a singlylinked 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  !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; } }
1, 2, 3, 4, 5, 6, 7  
2, 1, 4, 3, 6, 5, 7  
1, 3, 2, 5, 4, 7, 6  
2, 3, 4, 5, 6, 7, 1 
Discuss it
Question 54 Explanation:
Please see the link for more details http://www.geeksforgeeks.org/pairwiseswapelementsofagivenlinkedlist/
Question 55 
A binary search tree contains the numbers 1, 2, 3, 4, 5, 6, 7, 8. When the tree is traversed in preorder 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 postorder, the sequence obtained would be
8, 7, 6, 5, 4, 3, 2, 1  
1, 2, 3, 4, 8, 7, 6, 5  
2, 1, 4, 3, 6, 7, 8, 5  
2, 1, 4, 3, 7, 8, 6, 5 
Discuss it
Question 55 Explanation:
Please see this link for more details
http://www.geeksforgeeks.org/constructtreefromgiveninorderandpreordertraversal/
Question 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
4  
7  
23  
99 
Discuss it
Question 56 Explanation:
The task is to find minimum number of edges in a path in G from vertex 1 to vertex 100 such that we can move to either i+1 or 3i from a vertex i.
Since the task is to minimize number of edges, we would prefer to follow 3*i. Let us follow multiple of 3. 1 => 3 => 9 => 27 => 81, now we can't follow multiple of 3. So we will have to follow i+1. This solution gives a long path. What if we begin from end, and we reduce by 1 if the value is not multiple of 3, else we divide by 3. 100 => 99 => 33 => 11 => 10 => 9 => 3 => 1 So we need total 7 edges.
Question 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; }
5  
8  
9  
20 
Discuss it
Question 57 Explanation:
f(20,1) = 9. f(10,2)  1 = 9 f(5,4)  2 = 10 f(2,8) + 4 = 12 f(1,16)  8 = 8 f(0,32) + 16 = 16
Question 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[j]  a[i] > S  
a[j]  a[i] < S  
a[i]  a[j] < S  
a[i]  a[j] > S

Discuss it
Question 58 Explanation:
Please see the link below for full explanation
http://www.geeksforgeeks.org/findapairwiththegivendifference/
Question 59 
Let a and b be two sorted arrays containing n integers each, in nondecreasing order. Let c be a sorted array containing 2n integers obtained by merging the two arrays a and b. Assuming the arrays are indexed starting from 0, consider the following four statements
 a[i] ≥ b [i] => c[2i] ≥ a [i]
 a[i] ≥ b [i] => c[2i] ≥ b [i]
 a[i] ≥ b [i] => c[2i] ≤ a [i]
 a[i] ≥ b [i] => c[2i] ≤ b [i]
only I and II  
only I and IV  
only II and III  
only III and IV 
Discuss it
Question 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  Arrival 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 
30 sec, 30 sec  
30 sec, 10 sec  
42 sec, 42 sec  
30 sec, 42 sec 
Discuss it
Question 60 Explanation:
For Non preemptive scheduling
0 15 35 45
Turn Around Time= Completion Time  Arrival Time = 45 3 = 42
For Preemptive scheduling
0 1 2 3 4 5 25 33 45
Turn Around Time= Completion Time  Arrival Time = 33  3 = 30
P3(AT=0)  P1(AT=5)  P2(AT=3) 
P3  P3  P3  P2  P2  P1  P2  P3 
Question 61 
Consider a 2way set associative cache memory with 4 sets and total 8 cache blocks (07) and a main memory with 128 blocks (0127). 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
0 3 5 7 16 55  
0 3 5 7 9 16 55  
0 5 7 9 16 55  
3 5 7 9 16 55 
Discuss it
Question 61 Explanation:
2way set associative cache memory, .i.e K = 2. No of sets is given as 4, i.e. S = 4 ( numbered 0  3 ) No of blocks in cache memory is given as 8, i.e. N =8 ( numbered from 0 7) Each set in cache memory contains 2 blocks. The number of blocks in the main memory is 128, i.e M = 128. ( numbered from 0 127)
A referred block numbered X of the main memory is placed in the
set numbered ( X mod S ) of the the cache memory. In that set, the
block can be placed at any location, but if the set has already become
full, then the current referred block of the main memory should replace
a block in that set according to some replacement policy. Here
the replacement policy is LRU ( i.e. Least Recently Used block should
be replaced with currently referred block).
X ( Referred block no ) and
the corresponding Set values are as follows:
X>set no ( X mod 4 )
0>0 ( block 0 is placed in set 0, set 0 has 2 empty block locations,
block 0 is placed in any one of them )
5>1 ( block 5 is placed in set 1, set 1 has 2 empty block locations,
block 5 is placed in any one of them )
3>3 ( block 3 is placed in set 3, set 3 has 2 empty block locations,
block 3 is placed in any one of them )
9>1 ( block 9 is placed in set 1, set 1 has currently 1 empty block location,
block 9 is placed in that, now set 1 is full, and block 5 is the
least recently used block )
7>3 ( block 7 is placed in set 3, set 3 has 1 empty block location,
block 7 is placed in that, set 3 is full now,
and block 3 is the least recently used block)
0>block 0 is referred again, and it is present in the cache memory in set 0,
so no need to put again this block into the cache memory.
16>0 ( block 16 is placed in set 0, set 0 has 1 empty block location,
block 0 is placed in that, set 0 is full now, and block 0 is the LRU one)
55>3 ( block 55 should be placed in set 3, but set 3 is full with block 3 and 7,
hence need to replace one block with block 55, as block 3 is the least
recently used block in the set 3, it is replaced with block 55.
Hence the main memory blocks present in the cache memory are : 0, 5, 7, 9, 16, 55 .
(Note: block 3 is not present in the cache memory, it was replaced with block 55 )
Read the following articles to learn more related to the above question:
Cache Memory
Cache Organization  Introduction
Question 62 
Two shared resources R_{1} and R_{2} are used by processes P_{1} and P_{2}. Each process has a certain priority for accessing each resource. Let T_{ij} denote the priority of P_{i} for accessing R_{j}. A process P_{i} can snatch a resource R_{h} from process P_{j} if T_{ik} is greater than T_{jk}.
Given the following :
 T_{11} > T_{21}
 T_{12} > T_{22}
 T_{11} < T_{21}
 T_{12} < T_{22}
(I) and (IV)  
(II) and (III)  
(I) and (II)  
None of the above 
Discuss it
Question 62 Explanation:
If all the resources are allocated to one process then deadlock will never occur. So, if we allocate both R1 and R2 to process P1 or both R1 and R2 to process P2 then deadlock can be prevented. When one process completes its execution then both the resources are allocated to the other process. So, either condition (I) and (II) or condition (III) and (IV) ensures that deadlock never occurs.
Thus, option (C) is correct.
Please comment below if you find anything wrong in the above post.
Question 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 book keeping 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?
35400 and 35800 bytes  
35800 and 35400 bytes  
35600 and 35400 bytes  
35400 and 35600 bytes 
Discuss it
Question 63 Explanation:
Using 100 bytes disk blocks :
1. File of size 11050 bytes Blocks required to store data = 11050/100 = 111 Blocks required for bookkeeping = (111 * 4)/100 = 5 Total blocks = 111 + 5 = 116
2. File of size 4990 bytes Blocks required to store data = 4990/100 = 50 Blocks required for bookkeeping = (50 * 4)/100 = 2 Total blocks = 50 + 2 = 52
3. File of size 5170 bytes Blocks required to store data = 5170/100 = 52 Blocks required for bookkeeping = (52 * 4)/100 = 3 Total blocks = 52 + 3 = 55
4. File of size 12640 bytes Blocks required to store data = 12640/100 = 127 Blocks required for bookkeeping = (127 * 4)/100 = 6 Total blocks = 127 + 6 = 133
Total space required for storing the files using 100 byte disk blocks = (116 + 52 + 55 + 133) * 100 = 35600 bytes
Using 200 bytes disk blocks :
1. File of size 11050 bytes Blocks required to store data = 11050/200 = 56 Blocks required for bookkeeping = (56 * 4)/200 = 2 Total blocks = 56 + 2 = 58
2. File of size 4990 bytes Blocks required to store data = 4990/200 = 25 Blocks required for bookkeeping = (25 * 4)/200 = 1 Total blocks = 25 + 1 = 26
3. File of size 5170 bytes Blocks required to store data = 5170/200 = 26 Blocks required for bookkeeping = (26 * 4)/200 = 1 Total blocks = 26 + 1 = 27
4. File of size 12640 bytes Blocks required to store data = 12640/200 = 64 Blocks required for bookkeeping = (64 * 4)/200 = 2 Total blocks = 64 + 2 = 66
Total space required for storing the files using 100 byte disk blocks = (58 + 26 + 27 + 66) * 200 = 35400 bytes
Thus, option (C) is correct.
Please comment below if you find anything wrong in the above post.
Question 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
205 days  
300 days  
500 days  
700 days 
Discuss it
Question 64 Explanation:
Availability = MTBF/(MTBF + MTTR)
Option 1 : 0.9 = 200/(200 + a) = 22.22
Case 2 :0.95 = b/(b+22.22+5)= 517.18(near to option C)
Question 65 
To carry out white box testing of a program, its flow chart representation is obtained as shown in the figure below:
For basis path based testing of this program, its cyclomatic complexity is
5  
4  
3  
2 
Discuss it
Question 65 Explanation:
N(nodes) = 9
E(edges) = 10
Cyclomatic Complexity = E  N + 2P
= 10 9 + 2*1
= 3
Question 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
p1 invokes p2, p2 invokes either p3, or p4, or p5  
p2 invokes p1, and then invokes p3, or p4, or p5  
A new module Tc is defined to control the transaction flow. This module Tc first invokes pl and then invokes  
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 
Discuss it
Question 66 Explanation:
N(nodes) = 9
E(edges) = 10
Cyclomatic Complexity = E  N + 2P
= 10 9 + 2*1
= 3
Question 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; 
Execute T1 followed by T2 followed by T3  
Execute T2, followed by T3; T1 running concurrently throughout  
Execute T3 followed by T2; T1 running concurrently throughout  
Execute T3 followed by T2 followed by T1 
Discuss it
Question 67 Explanation:
T3 followed by T2 followed by T1
If this sequence is not followed then it may happen that Officer of one slab get benefited twice.
Say an officer is having commission as 99,999,He must be get updated commision according to T2.But then
99,999*1.04=1,03998 and he again becomes eligible for next slab of commision.
T3 followed by T2 followed by T1 will be check all border cases like above.So Answer is D
Question 68 
A table 'student' with schema (roll, name, hostel, marks), and another table 'hobby' with schema (roll, hobbyname) contains records as shown below:
The following SQL query is executed on the above tables:
Roll  Name  Hostel  Marks 

1798  Manoj Rathod  7  95 
2154  Soumic Banerjee  5  68 
2369  Gumma Reddy  7  86 
2581  Pradeep Pendse  6  92 
2643  Suhas Kulkarni  5  78 
2711  Nitin Kadam  8  72 
2872  Kiran Vora  5  92 
2926  Manoj Kunkalikar  5  94 
2959  Hemant Karkhanis  7  88 
3125  Rajesh Doshi  5  82 
Roll  Hobbyname 

1798  chess 
1798  music 
2154  music 
2369  swimming 
2581  cricket 
2643  chess 
2643  hockey 
2711  volleyball 
2872  football 
2926  cricket 
2959  photography 
3125  music 
3125  chess 
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: S’ = ∏_{hostel }((σ_{s.roll = H.roll} (σ_{marks > 75 and roll > 2000 and roll < 3000 }(S)) X (H)) The difference between the number of rows output by the SQL statement and the number of tuples in S’ is
6  
4  
2  
0 
Discuss it
Question 68 Explanation:
Output of above Query
Total rows selected by running SQL Query: 7
Total rows by Relation Algebra : 4 i.e 5,6,7 (Unique values only)
73=4
Answer is B
Roll  Hostel 

2369  7 
2581  6 
2643  5 
2643  5 
2872  5 
2926  5 
2959  7 
Question 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 stocklevel 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 warehouse at Nagpur, this query will find all suppliers who
do not supply any item  
supply exactly one item  
supply one or more items  
supply two or more items 
Discuss it
Question 70 
In a schema with attributes A, B, C, D and 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?
CD → AC  
BD → CD  
BC → CD  
AC → BC 
Discuss it
Question 70 Explanation:
Please see this article to learn the concept
http://geeksquiz.com/equivalenceoffunctionaldependenciessets/
Question 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 x 10^{8} m/sec. The minimum frame size for this network should be
10000 bits  
10000 bytes  
5000 bits  
5000 bytes 
Discuss it
Question 71 Explanation:
Frame Size S >= 2BL/P Where, Cable Length L = 1KM = 1000M Propogation Speed P = 2 x 10^8 m/sec Bandwidth = 1 Gbps = 10^9 bps See this for details of above formula. S >= (2 * 10^9 * 1000) / (2 x 10^8) >= 10000 bits
Question 72 
A channel has a bit rate of 4 kbps and oneway 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
80 bytes  
80 bits  
160 bytes  
160 bits 
Discuss it
Question 72 Explanation:
Bit rate = 4 kbps Oneway propagation delay = 20 ms
Efficiency = Transmission time of packet/(Transmission time of packet + 2 * Propagation delay) 0.5 = x/(x + 2 * 20 * 10^{3}) x = 20 * 10^{3} x = 40 * 10^{3}
Minimum frame size / Bit rate = 40 * 10^{3} Therefore, Minimum frame size = 40 * 10^{3} * 4 * 10^{3} = 160 bits
Thus, option (D) is correct.
Please comment below if you find anything wrong in the above post.
Question 73 
On a TCP connection, current congestion window size is Congestion Window = 4 KB. The window size advertised by the receiver 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
2048 bytes  
4096 bytes  
6144 bytes  
8192 bytes 
Discuss it
Question 73 Explanation:
Congestion Window: It is the factor which tells how much maximum byte can be sent through network in TCP connection. It is dynamic in TCP.
Receiver Advertised Window: It is the factor which tells what is the maximum capacity of receiver to receive the data in bytes.
Total amount of maximum bytes that can be send by receiver at any time is called receiver window size.
At any time receiver can send minimum of Congestion Window and Receiver Advertised Window.
Thus current window size=min(congestion window ,receiver advertised window)
=min(4KB,6KB)
=4KB
=4*1024 bytes=4096bytes
But this is confusing question In my opinion 4KB will be for first time.
After that Receiver Window Size will be = buffered data(unacknowledged) + min(congestion window ,receiver advertised window)
= Unacknowledged data= (102408192)bytes=2048 bytes.
= (4096+2048) bytes=6144 bytes
This solution is contributed by Abhishek Kumar.
Question 74 
In a communication network, a packet of length L bits takes link L1 with a probability of p_{1}or link L2 with a probability of p_{2}. Link L1 and L2 have bit error probability of b_{1} and b_{2}respectively. The probability that the packet will be received without error via either L1 or L2 is
(1  b1)Lp1 + (1  b2)Lp2  
[1  (b1 + b2)L]p1p2  
(1  b1)L (1  b2)Lp1p2  
1  (b1Lp1 + b2Lp2) 
Discuss it
Question 74 Explanation:
Number of bits in a packet = L bits
Probability of link 'l1' = p1 Bit error probability for link 'l1' = b1 No bit error probability for link 'l1' = (1  b1)
Probability of link 'l2' = p2 Bit error probability for link 'l2' = b2 No bit error probability for link 'l2' = (1  b2)
Link 'l1' and 'l2' are mutually exclusive. Thus, probability that the packet will be received without error = (1  b1)^{L}p1 + (1  b2)^{L}p2
Thus, option (A) is correct.
Please comment below if you find anything wrong in the above post.
Question 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 endtoend propagation delay. Assume a propagation speed of 2 x 10^{8} m/sec. The length of the LAN is 1 km with a bandwidth of 10 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
3  
5  
10  
20 
Discuss it
Question 75 Explanation:
Tt = 10^(5) seconds Tp = 0.5*10^(5) seconds efficiency = [1/(1+a)] where a = (Tp/Tt) = 0.5 therefore efficiency = 2/3 effective bandwidth = (2/3)*10Mbps number of users = {(2/3)*10} / (2/3) = 10 therefore answer is (C)
Question 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?
204.204.204.128/255.255.255.192
204.204.204.0/255.255.255.128
204.204.204.64/255.255.255.128  
204.204.204.0/255.255.255.192
204.204.204.192/255.255.255.128
204.204.204.64/255.255.255.128  
204.204.204.128/255.255.255.128
204.204.204.192/255.255.255.192
204.204.204.224/255.255.255.192  
204.204.204.128/255.255.255.128
204.204.204.64/255.255.255.192
204.204.204.0/255.255.255.192 
Discuss it
Question 76 Explanation:
Background Reading:
IP address is used to uniquely identify a host.
>Address range Class A 1.0.0.1 to 126.255.255.254 Class B 128.1.0.1 to 191.255.255.254 Class C 192.0.1.1 to 223.255.254.254 Class D 224.0.0.0 to 239.255.255.255(127.0.0.0 to 127.255.255.255  used for loopback functionality : which will point back to the computer's own tcp/ip network configuration.) (1)x.x.x.0 and x.x.x.255 addresses are used for directed broadcast address and network ID. So,these two addresses are not used by hosts. (2)Network ID is computed by performing logical & on IP address with subnet mask. > IPV4 addresses are 32 bit and they are used as follows for:
Identifying Networks(bit no.) Identifying Hosts(bit no.) Class A 18 932 Class B 116 1732 Class C 124 2532Now, let's come back to the question: Here, company has class C address of 204.204.204.0(11001100.11001100.11001100.00000000), 124 bits are identifying the network. So, network has IP addresses from 204.204.204.0 to 204.204.204.255. >Subnetting is a practice in which we can divide the network in two or more parts. For this we will have to borrow few bits from the hosts part. > In subnet mask, all network + subnetwork bits are 1 and host bits are 0.
Option (A) 204.204.204.128/255.255.255.192 204.204.204.0/255.255.255.128 204.204.204.64/255.255.255.1281) 11001100.11001100.11001100.10000000/11111111.11111111.11111111.11000000 Network bits26 (as 26 bits are 1 in the subnet mask) so subnetwork id = 204.204.204.128 (refer(2)) 6 bits '0' in subnet mask,i.e. 64(i.e. 2^6) 2 = 62 hosts (refer (1) ) 2) 11001100.11001100.11001100.00000000/11111111.11111111.11111111.10000000 Network bits25 (as 25 bits are 1 in the subnet mask) so subnetwork id = 204.204.204.0 (refer(2)) 7 bits '0' in subnet mask,i.e. 128(i.e.2^7) 2 =126 hosts (refer (1) ) 3) 11001100.11001100.11001100.01000000/11111111.11111111.11111111.10000000 Network bits25 (as 25 bits are 1 in the subnet mask) so subnetwork id = 204.204.204.0 ( refer(2)) 7 bits '0' in subnet mask,i.e. 128(i.e.2^7) 2 = 126 hosts (refer (1) ) Though the networks are divided into subnets containing 62,126,126 hosts which satisfy our minimum criteria of 50,50,100. But, two subnets have same network ID thus,they are not different.Thus,this division is only of two subnets but we need 3 ,so A option is incorrect.
Option (B) 204.204.204.0/255.255.255.192 204.204.204.192/255.255.255.128 204.204.204.64/255.255.255.1281) 11001100.11001100.11001100.00000000/11111111.11111111.11111111.11000000 Network bits26 (as 26 bits are 1 in the subnet mask) so subnetwork id = 204.204.204.0 (refer(2)) 6 bits '0' in subnet mask,i.e. 64(i.e. 2^6)2=62 hosts (refer (1)) 2) 11001100.11001100.11001100.11000000/11111111.11111111.11111111.10000000 Network bits25 (as 25 bits are 1 in the subnet mask) so subnetwork id = 204.204.204.128 (refer(2)) 7 bits '0' in subnet mask,i.e. 128(i.e.2^7)2=126 hosts (refer (1)) 3) 11001100.11001100.11001100.01000000/11111111.11111111.11111111.10000000 Network bits25 (as 25 bits are 1 in the subnet mask) so subnetwork id = 204.204.204.0 (refer(2)) 7 bits '0' in subnet mask,i.e. 128(i.e.2^7)2=126 hosts (refer (1)) Though the networks are divided into subnets containing 62,126,126 hosts which satisfy our minimum criteria of 50,50,100. But, two subnets have same network ID thus,they are not different.Thus,this division is only of two subnets.
Option (C) 204.204.204.128/255.255.255.128 204.204.204.192/255.255.255.192 204.204.204.224/255.255.255.1921) 11001100.11001100.11001100.10000000/11111111.11111111.11111111.10000000 Network bits25 (as 25 bits are 1 in the subnet mask) so subnetwork id == 204.204.204.128 (refer(2)) 7 bits '0' in subnet mask,i.e. 128(i.e. 2^7) 2 =126 hosts (refer 1) 2) 11001100.11001100.11001100.11000000/11111111.11111111.11111111.11000000 Network bits26 (as 25 bits are 1 in the subnet mask) so subnetwork id == 204.204.204.192 (refer(2)) 6 bits '0' in subnet mask,i.e. 64(i.e.2^6)2=62 hosts(refer 1) 3) 11001100.11001100.11001100.11110000/11111111.11111111.11111111.11000000 Network bits26 (as 26 bits are 1 in the subnet mask) so subnetwork id == 204.204.204.192 (refer (2)) 6 bits '0' in subnet mask,i.e. 64(i.e.2^6) 2=62 hosts (refer 1) Though the networks are divided into subnets containing 62,62,126 hosts which satisfy our minimum criteria of 50,50,100. But, two subnets have same network ID thus,they are not different.Thus,this division is only of two subnets.
Option (D) 204.204.204.128/255.255.255.128 204.204.204.64/255.255.255.192 204.204.204.0/255.255.255.1921) 11001100.11001100.11001100.10000000/11111111.11111111.11111111.10000000 > Network bits25 (as 25 bits are 1 in the subnet mask) so subnetwork id == 204.204.204.128 (refer(2)) 7 bits '0' in subnet mask,i.e. 128(i.e. 2^7)2=126 hosts (refer(1)) 2) 11001100.11001100.11001100.01000000/11111111.11111111.11111111.11000000 > Network bits26 (as 25 bits are 1 in the subnet mask) so subnetwork id == 204.204.204.64 (refer(2)) 6 bits '0' in subnet mask,i.e. 64(i.e.2^6)2=62 hosts (refer(1)) 3) 11001100.11001100.11001100.00000000/11111111.11111111.11111111.11000000 > Network bits26 (as 26 bits are 1 in the subnet mask) so subnetwork id == 204.204.204.0 (refer(2)) 6 bits '0' in subnet mask,i.e. 64(i.e.2^6)2=62 host bits (refer(1)) This satisfies the minimum criteria of 50,50 and 100 hosts and all subnet IDs are different .Thus,option D is correct. This explanation is provided by Shashank Shanker.
Question 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".
Query a NS for the root domain and then NS for the "dom" domains  
Directly query a NS for "dom" and then a NS for "mydomain.dom" domains  
Query a NS for inaddr.arpa and then a NS for 128.145.inaddr.arpa domains  
Directly query a NS for 145.inaddr.arpa and then a NS for 128.145.inaddr.arpa domains 
Discuss it
Question 77 Explanation:
Background:
When you type a web address into a web browser like www.google.com your computer needs to convert that into an IP address so that it can contact that web server & deliver the web page to you.
In a forward DNS lookup client first asks ISP(Internet Service Provider) for the dns of the domain name.ISP maintains a cache for the IP address of the domains whose lookup has been already made.If IP is not found in the cache then the ISP asks the root level dns server,which is a network of hundreds of servers in many countries around the world.Nearest root level DNS for India is in Tokyo.
The root level server then redirects it to another server ,say we are searching for geeksforgeeks.org then root level server will redirect isp to org server which will in turn redirect to geeksforgeeks server and from here ISP get the particular IP address which is then sent to the client. Forward dns lookup
domain name  IP
Reverse dns lookup
IPdomain name
special address domain  in.addr.arpa (this domain basically converts to inverse domain)
IPv6 addresses use the ip6.arpa domain.
Now,ISP maintains a list of IP addresses corresponding to domain name and also domain names corresponding to the IP addresses.
inaddr.arpa is the domain name server
For IP address say 192.19.20.1(which is say IP address of geeksforgeeks) the corresponding entry will be
“1.20.19.192.inaddr.arpa. IN PTR www.geeksforgeeks.org.”
which will point back to www.geeksforgeeks.org .This helps in checking the ip address of the sender.
The IP in the entry is in reverse order .
This solution is contributed by Shashank .
Question 78 
Consider the following message M = 1010001101. The cyclic redundancy check (CRC) for this message using the divisor polynomial x^{5} + x^{4} + x^{2} + 1 is :
01110  
01011  
10101  
10110 
Discuss it
Question 78 Explanation:
M = 1010001101 Divisor polynomial: 1.x5 +1.x4+0.x3+1.x2+0.x2+1.x0 Divisor polynomial bit= 110101 Bits to be appended to message= (divisor polynomial bits – 1) = 5 Append 5 zeros to message bits, modified message: 101000110100000Now, divide and XOR the message with divisor polynomial bits. Make resultant reminder to 5 bit again and that is the CRC send along with the message. This explanation has been contributed by Sandeep Pandey. Please visit the following links to learn more on CRC and its calulation: Wikipedia article: Cyclic Redundancy Check GeeksforGeeks article: Error Detection  Computer Networks
Question 79 
Suppose that two parties A and B wish to setup a common secret key (DH key) between themselves using the DiffieHellman 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 DH key is
3  
4  
5  
6 
Discuss it
Question 79 Explanation:
Primitive root = g = 3 Modulus = p = 7 Xa = 2 and Xb = 5
Ya = 3^{2} mod 7 = 2 Yb = 3^{5} mod 7 = 5
We assume DH key to be K.
K = Ya^{Xb} mod 7 K = 2^{5}mod 7 = 4 Or K = Yb^{Xa} mod 7 K = 6^{2} mod 7 = 1
Thus, option (B) is correct.
Please comment below if you find anything wrong in the above post.
Question 80 
Given below is an excerpt of an xml specification.
<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 "library.dtd". For which excerpt would the above specification be valid?
<!ELEMENT Book (title+, type, accno)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT type EMPTY>
<!ATTLIST type value (BROCHURE/FICTION/TECHNICAL)>
<!ELEMENT accno (#PCDATA)>  
<!ELEMENT Book (title?, type, accno)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT type ATTLIST>
<!ATTLIST type value (BROCHURE/FICTION/TECHNICAL)>
<!ATTLIST accno value (#PCDATA)>  
<!ELEMENT Book (title*, type, accno)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT type ATTLIST>
<!ATTLIST type value (BROCHURE/FICTION/TECHNICAL)>
<!ELEMENT accno (#PCDATA)>  
<!ELEMENT Book (title?, type, accno)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT type EMPTY>
<!ATTLIST type value (BROCHURE/FICTION/TECHNICAL)>
<!ELEMENT accno (#PCDATA)> 
Discuss it
Question 81 
Q81 Part_A
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.
What is the total amount of data that can be stored on the disk if it is used with a drive that rotates it with (i) Constant Linear Velocity (ii) Constant Angular Velocity?
(i) 80 MB (ii) 2040 MB  
(i) 2040 MB (ii) 80 MB  
(i) 80 MB (ii) 360 MB  
(i) 360 MB (ii) 80 MB 
Discuss it
Question 81 Explanation:
Constant linear velocity :
Diameter of inner track = d = 1cm Circumference of inner track : = 2 * 3.14 * (d/2) = 3.14 cm
Storage capacity = 10 MB (given) Circumference of all equidistant tracks : = 2 * 3.14 *(0.5 + 1 + 1.5 + 2 + 2.5 + 3+ 3.5 + 4) = 113.14cm
Here, 3.14 cm holds 10 MB. Therefore, 1 cm holds 3.18 MB. 113.14 cm holds 113.14 * 3.18 = 360 MB. Total amount of data that can be stored on the disk = 360 MB
Constant angular velocity :
In case of CAV, the disk rotates at a constant angular speed. Same rotation time is taken by all the tracks. Total amount of data that can be stored on the disk = 8 * 10 = 80 MB
Thus, option (D) is correct.
Please comment below if you find anything wrong in the above post.
Question 82 
Q 81_Part B
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.
If the disk has 20 sectors per track and is currently at the end of the 5^{th} sector of the innermost 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 outermost track?
13.5 ms  
10 ms  
9.5 ms  
20 ms 
Discuss it
Question 82 Explanation:
Radius of innermost track = 0.5 cm Radius of outermost track = 4 cm Distance traversed by header = 4 – 0.5 = 3.5 cm = 3.5 * 100 m = 350 m Time taken by header = 350 * 10 = 3500 s = 3.5 ms
It is given that header at the end of the 5th sector of the innermost track. To start from front of 4th sector it must rotate upto 18 sector.
Thus, header does 6000 rotations in 60000ms and 1 rotation in 10 ms. So, to traverse sector 18 it takes 9 ms.
Storage capacity = 10 MB Thus, 10 MB data is read in 10 ms. 1 MB can be read in 1 ms.
Total time taken to read 1 MB contiguous data = (1 + 9 + 3.5) ms = 13.5ms
Thus, option (A) is correct.
Please comment below if you find anything wrong in the above post.
Question 83 
Q 82_Part A
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.
If Nestedloop join algorithm is employed to perform the join, with the most appropriate choice of table to be used in outer loop, the number of block accesses required for reading the data are
800000  
40080  
32020  
100 
Discuss it
Question 83 Explanation:
Number of block access = n_{r} * b_{s} + b_{r} where b_{r} and b_{s} are number of blocks in relations R and S respectively, and n_{r} is the number of tuples in relation R.
We select the relation with small number of tuples as outer relation R. So, R is T2.
Number of block access = 400 * 80 + 20 = 32020
Thus, option (C) is correct.
Please comment below if you find anything wrong in the above post.
Question 84 
Q82_Part B
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.
If, instead of Nestedloop join, Block nestedloop join is used, again with the most appropriate choice of table in the outer loop, the reduction in number of block accesses required for reading the data will be
0  
30400  
38400  
798400 
Discuss it
Question 84 Explanation:
Number of block access = n_{r} * b_{s} + b_{r} where b_{r} and b_{s} are number of blocks in relations R and S respectively, and n_{r} is the number of tuples in relation R.
We select the relation with small number of tuples as outer relation R. So, R is T2. Number of block access = 400 * 80 + 20 = 32020
The memory buffer space holds one block of records for T1 and one block of records for T2 simultaneously. So, number of block accesses is 80 * 20 + 20 = 1620
So, Total number of block access = 32020  1620 = 30400
Thus, option (B) is correct.
Please comment below if you find anything wrong in the above post.
Question 85 
Q83 Part_A
Consider the contextfree grammar
E → E + E
E → (E * E)
E → id
where E is the starting symbol, the set of terminals is {id, (,+,),*}, and the set of nonterminals is {E}.
Which of the following terminal strings has more than one parse tree when parsed according to the above grammar?
id + id + id + id  
id + (id* (id * id))  
(id* (id * id)) + id  
((id * id + id) * id) 
Discuss it
Question 85 Explanation:
According to leftmost derivation :
E > E + E (using E > E + E) E > E + E + E (using E > E + E) E > E + E + E + E (using E > E + id) E > id + E + E + E (using E > id) E > id + id + E + E (using E > id) E > id + id + id + E (using E > id) E > id + id + id + id
According to rightmost derivation :
E > E + E (using E > E + E) E > E + E + E (using E > E + E) E > E + E + E + E (using E > E + id) E > E + E + E + id (using E > id) E > E + E + id + id (using E > id) E > E + id + id + E (using E > id) E > id + id + id + id
Thus, option (A) is correct.
Please comment below if you find anything wrong in the above post.
Question 86 
Q 83_Part B
Consider the contextfree grammar
E → E + E
E → (E * E)
E → id
where E is the starting symbol, the set of terminals is {id, (,+,),*}, and the set of nonterminals is {E}.
For the terminal string id + id + id + id, how many parse trees are possible?
5  
4  
3  
2 
Discuss it
Question 86 Explanation:
Background Required to solve the question  Parse Tree Construction.
Explanation : In order to produce the yield id + id + id + id , we only required 3 productions of type E → E + E as 3 ‘+’ are required in the final string. This can be done in 5 ways as shown in the picture given below:This explanation has been provided by Pranjul Ahuja.
Question 87 
Q84 Part_A
A sink in a directed graph is a vertex i such that there is an edge from every vertex j ≠ i to i and there is no edge from i to any other vertex. A directed graph G with n vertices is represented by its adjacency matrix A, where A[i] [j] = 1 if there is an edge directed from vertex i to j and 0 otherwise. The following algorithm determines whether there is a sink in the graph G.
i = 0 do { j = i + 1; while ((j < n) && E1) j++; if (j < n) E2; } while (j < n); flag = 1; for (j = 0; j < n; j++) if ((j! = i) && E3) flag = 0; if (flag) printf("Sink exists"); else printf ("Sink does not exist");
E1 : A[i][j] and E2 : i = j;  
E1 : !A[i][j] and E2 : i = j + 1;  
E1: !A[i][j] and E2 : i = j;  
E1 : A[i][j] and E2 : i = j + 1; 
Discuss it
Question 87 Explanation:
For vertex i to be a sink, there should be no edge from i to any other vertex.
According the input given in question,
A[i][j] = 1 means there is an edge from vertex i to j. A[i][j] = 0 means there is no edge from i to jFor a node to i to be sink,
A[i][j] should be 0 for all j A[j][i] should be 1 for all j.The above pseudo code checks every vertex i for sink, starting from i = 0. It basically checks every vertex j after i for being a sink. The trick in pseudo code is, it doesn't check for j smaller than i. The i picked by this loop may not be sink. It basically makes sure that we don't ignore a potential sink. The check whether i is actually a sink or not is done later after do while loop. Vertex i is a potential sink while A[i][j] is zero Thus, E1 : !A[i][j] If the above condition is false, then i is not a sink. All j < i can also not be a sink because there is no edge from i to j. Now, the next potential sink can be j. So, E2 : i = j Thus, option (C) is correct.
Question 88 
Q84 Part_B
A sink in a directed graph is a vertex i such that there is an edge from every vertex j ≠ i to i and there is no edge from i to any other vertex. A directed graph G with n vertices is represented by its adjacency matrix A, where A[i] [j] = 1 if there is an edge directed from vertex i to j and 0 otherwise. The following algorithm determines whether there is a sink in the graph G.
i = 0 do { j = i + 1; while ((j < n) && E1) j++; if (j < n) E2; } while (j < n); flag = 1; for (j = 0; j < n; j++) if ((j! = i) && E3) flag = 0; if (flag) printf("Sink exists"); else printf("Sink does not exist");
(A[i][j] && !A[j][i])  
(!A[i][j] && A[j][i])  
(!A[i][j]   A[j][i])  
(A[i][j]   !A[j][i])

Discuss it
Question 88 Explanation:
Below explanation is for Previous Part of this question:
For vertex i to be a sink, there should be no edge from i to any other vertex.
According the input given in question,
A[i][j] = 1 means there is an edge from vertex i to j. A[i][j] = 0 means there is no edge from i to jFor a node to i to be sink,
A[i][j] should be 0 for all j A[j][i] should be 1 for all j.The above pseudo code checks every vertex i for sink, starting from i = 0. It basically checks every vertex j after i for being a sink. The trick in pseudo code is, it doesn't check for j smaller than i. The i picked by this loop may not be sink. It basically makes sure that we don't ignore a potential sink. The check whether i is actually a sink or not is done later after do while loop. Vertex i is a potential sink while A[i][j] is zero Thus, E1 : !A[i][j] If the above condition is false, then i is not a sink. All j < i can also not be a sink because there is no edge from i to j. Now, the next potential sink can be j. So, E2 : i = j Explanation for this question The following pseudo code basically checks if the potential sink picked by the code above is actually a sink or not.
flag = 1; for (j = 0; j < n; j++) if ((j! = i) && E3) flag = 0;flag equals to 0 means i is not a sink. The code sets the flag 0 as soon as it finds out that i is not a sink.
A node i is not a sink if either of the following two conditions become true for any j not equal to i. A[i][j] is 1 for any j OR A[j][i] is 0 for any jE3 : (A[i][j]   !A[j][i]) Therefore option D is correct
Question 89 
Q85 Part_A
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.
 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 ∞.
 From each accessible neighbour, it gets the costs to relay to other nodes via that neighbour (as the next hop).
 Each node updates its routing table based on the information received in the previous two steps by choosing the minimum cost.
For the graph given above, possible routing tables for various nodes after they have stabilized, are shown in the following options. Identify the correct table.
1)  Table for node A


2)  Table for node C


3) 
Table for node B


4)  Table for node D

A  
B  
C  
D 
Discuss it
Question 90 
Q85 Part_B
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.
Continuing from the earlier problem, suppose at some time t, when the costs have stabilized, node A goes down. The cost from node F to node A at time (t + 100) is
 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 ∞.
 From each accessible neighbour, it gets the costs to relay to other nodes via that neighbour (as the next hop).
 Each node updates its routing table based on the information received in the previous two steps by choosing the minimum cost.
For the graph given above, possible routing tables for various nodes after they have stabilized, are shown in the following options. Identify the correct table.
1)  Table for node A


2)  Table for node C


3) 
Table for node B


4)  Table for node D

>100 but finite  
∞  
3  
>3 and ≤100 
Discuss it
There are 90 questions to complete.