Question : 1
After Rajendra Chola returned from his voyage to Indonesia, he ________ to visit the temple in Thanjavur.
was wishing
is wishing
wished
had wished
Correct Answer : C
Question Type : MCQ
Max Marks : 1
Negative Marks : 0.33
Question : 2
Research in the workplace reveals that people work for many reasons _______________ .
money beside
beside money
money besides
besides money
Correct Answer : D
Question Type : MCQ
Max Marks : 1
Negative Marks : 0.33
Question : 3
Rahul, Murali, Srinivas and Arul are seated around a square table. Rahul is sitting to the left of Murali. Srinivas is sitting to the right of Arul. Which of the following pairs are seated opposite each other?
Rahul and Murali
Srinivas and Arul
Srinvas and Murali
Srinivas and Rahul
Correct Answer : C
Question Type : MCQ
Max Marks : 1
Negative Marks : 0.33
Question : 4
Find the smallest number \(y\) such that \(y×162\) is a perfect cube.
24
27
32
36
Correct Answer : D
Question Type : MCQ
Max Marks : 1
Negative Marks : 0.33
Question : 5
The probability that a \(k\)-digit number does NOT contain the digits 0,5, or 9 is
\(0.3^k\)
\(0.6^k\)
\(0.7^k\)
\(0.9^k\)
Correct Answer : C
Question Type : MCQ
Max Marks : 1
Negative Marks : 0.33
Question : 6
"The hold of the nationalist imagination on our colonial past is such that anything inadequately or improperly nationalist is just not history."
Which of the following statements best reflects the author's opinion?
Nationalists are highly imaginative.
History is viewed through the filter of nationalism.
Our colonial past never happened.
Nationalism has to be both adequately and properly imagined.
Correct Answer : B
Question Type : MCQ
Max Marks : 2
Negative Marks : 0.67
Question : 7
Six people are seated around a circular table. There are at least two men and two women. There are at least three right-handed persons. Every woman has a left-handed person to her immediate right. None of the women are right-handed. The number of women at the table is
2
3
4
Cannot be determined
Correct Answer : A
Question Type : MCQ
Max Marks : 2
Negative Marks : 0.67
Question : 8
The expression \(\large \frac{(x+y) - |x-y|}{2}\) is equal to :
The maximum of \(x\) and \(y\)
The minimum of \(x\) and \(y\)
1
None of the above
Correct Answer : B
Question Type : MCQ
Max Marks : 2
Negative Marks : 0.67
Question : 9
Arun, Gulab, Neel and Shweta must choose one shirt each from a pile of four shirts coloured red, pink, blue and white respectively. Arun dislikes the colour red and Shweta dislikes the colour white. Gulab and Neel like all the colours. In how many different ways can they choose the shirts so that no one has a shirt with a colour he or she dislikes?
21
18
16
14
Correct Answer : D
Question Type : MCQ
Max Marks : 2
Negative Marks : 0.67
Question : 10
A contour line joins locations having the same height above the mean sea level. The following is a contour plot of a geographical region. Contour lines are shown at 25 \(m\) intervals in this plot. If in a flood, the water level rises to 525 \(m\), which of the villages \(P, Q, R, S, T\) get submerged?
\(P, Q\)
\(P, Q, T\)
\(R, S, T\)
\(Q, R, S\)
Correct Answer : C
Question Type : MCQ
Max Marks : 2
Negative Marks : 0.67
Question : 11
The statement \((¬p)⇒(¬q)\) is logically equivalent to which of the statements below?
I. \(p \Rightarrow q\)
II. \(q \Rightarrow p\)
III. \(\left ( ¬q \right ) \vee p\)
IV. \(\left ( ¬p \right ) \vee q\)
I only
I and IV only
II only
II and III only
Correct Answer : D
Question Type : MCQ
Max Marks : 1
Negative Marks : 0.33
Question : 12
Consider the first-order logic sentence \(F:\forall x(\exists yR(x,y))\). Assuming non-empty logical domains, which of the sentences below are implied by \(F\) ?
I. \(\exists y(\exists xR(x,y))\)
II \(\exists y(\forall xR(x,y))\)
III. \(\forall y(\exists xR(x,y))\)
IV. \(¬\exists x(\forall y¬R(x,y))\)
IV only
I and IV only
II only
II and III only
Correct Answer : B
Question Type : MCQ
Max Marks : 1
Negative Marks : 0.33
Question : 13
Let \(c_{1}.....c_{n}\) be scalars, not all zero, such that \(\sum_{i=1}^{n}c_{i}a_{i}\) where are column vectors in \(a_{i}\).
Consider the set of linear equations
\(Ax = b\)
where \(A=\left [ a_{1}.....a_{n} \right ]\) and \(b=\sum_{i=1}^{n}a_{i}\). The set of equations has
a unique solution at \(x=J_{n}\) where \(J_{n}\) denotes a \(n\)-dimensional vector of all 1.
no solution
infinitely many solutions
finitely many solutions
Correct Answer : C
Question Type : MCQ
Max Marks : 1
Negative Marks : 0.33
Question : 14
Consider the following functions from positive integers to real numbers:
\(10, \sqrt n, \ n ,\ log_2 \ n, \frac {100} {n}\)
The CORRECT arrangement of the above functions in increasing order of asymptotic complexity is:
\(log_2 \ n ,\frac {100} n, 10 ,\sqrt n, n\)
\(\frac {100} n ,10, log_2 \ n, \sqrt n, n\)
\(10, \frac {100} n ,\sqrt n, log_2 \ n , n\)
\(\frac {100} n, log_2 \ n, 10 , \sqrt n , n\)
Correct Answer : B
Question Type : MCQ
Max Marks : 1
Negative Marks : 0.33
Question : 15
Consider the following table:
\(\begin{array}{|l|l|}\hline \textbf{Algorithms} & \textbf{Design Paradigms} \\\hline \text{P. Kruskal} & \text{i. Divide and Conquer} \\\hline \text{Q. Quicksort} & \text{ii. Greedy} \\\hline \text{R. Floyd-Warshall} & \text{iii. Dynamic Programming}\\\hline \end{array} \)
Match the algorithms to the design paradigms they are based on.
\((P) \leftrightarrow (ii), (Q) \leftrightarrow (iii), (R) \leftrightarrow (i)\)
\((P) \leftrightarrow (iii), (Q) \leftrightarrow (i), (R) \leftrightarrow (ii)\)
\((P) \leftrightarrow (ii), (Q) \leftrightarrow (i), (R) \leftrightarrow (iii)\)
\((P) \leftrightarrow (i), (Q) \leftrightarrow (ii), (R) \leftrightarrow (iii)\)
Correct Answer : C
Question Type : MCQ
Max Marks : 1
Negative Marks : 0.33
Question : 16
Let \(T\) be a binary search tree with \(15\) nodes. The minimum and maximum possible heights of \(T\) are:
Note: The height of a tree with a single node is \(0\).
4 and 15 respectively.
3 and 14 respectively.
4 and 14 respectively.
3 and 15 respectively.
Correct Answer : B
Question Type : MCQ
Max Marks : 1
Negative Marks : 0.33
Question : 17
The n-bit fixed-point representation of an unsigned real number \(X\) uses \(f\) bits for the fraction part. Let \(i = n-f\). The range of decimal values for \(X\) in this representation is
\(2^{-f} to \ 2^i\)
\(2^{-f} to \ \left ( 2^{i} - 2^{-f} \right )\)
0 to \(2^i\)
\(0 \ to \ \left ( 2^{i} - 2^{-f} \right )\)
Correct Answer : D
Question Type : MCQ
Max Marks : 1
Negative Marks : 0.33
Question : 18
Consider the C code fragment given below.
typedef struct node { int data; node* next; } node; void join(node* m, node* n) { node* p = n; while(p->next != NULL) { p = p->next; } p->next = m; }
Assuming that m and n point to valid NULL-terminated linked lists, invocation of join will
append list m to the end of list n for all inputs.
either cause a null pointer dereference or append list m to the end of list n.
cause a null pointer dereference for all inputs.
append list n to the end of list m for all inputs.
Correct Answer : B
Question Type : MCQ
Max Marks : 1
Negative Marks : 0.33
Question : 19
When two 8-bit numbers \(A_{7}\cdots A_{0}\) and \(B_{7}\cdots B_{0}\) in 2's complement representation (with \(A_{0}\) and \(B_{0}\) as the least significant bits) are added using a ripple-carry adder, the sum bits obtained are \(S_{7}\cdots S_{0}\) and the carry bits are \(C_{7}\cdots C_{0}\). An overflow is said to have occurred if
the carry bit \(C_{7}\) is
all the carry bits \(\left ( C_{7},\cdots ,C_{0} \right )\) are 1
\(\left ( A_{7} \cdot B_{7} \cdot \overline{S_{7}}+\overline{A_{7}} \cdot \overline{B_{7}} \cdot S_{7} \right )\) is 1
\(\left ( A_{0} \cdot B_{0} \cdot \overline{S_{0}}+\overline{A_{0}} \cdot \overline{B_{0}} \cdot S_{0} \right )\) is 1
Correct Answer : C
Question Type : MCQ
Max Marks : 1
Negative Marks : 0.33
Question : 20
Consider the following context-free grammar over the alphabet \(\Sigma = \{a,b,c\}\) with \(S\) as the start symbol:
\(S \rightarrow abScT \mid abcT\)
\(T \rightarrow bT \mid b\)
Which one of the following represents the language generated by the above grammar?
\(\{\left ( ab \right )^{n}\left ( cb \right )^{n} \mid n \geq 1 \}\)
\(\{\left ( ab \right )^{n}cb^{m_{1}}cb^{m_{2}}...cb^{m_{n}} \mid n, m_{1}, m_{2}, ..., m_{n} \geq 1 \}\)
\(\{\left ( ab \right )^{n}\left ( cb^{m} \right )^{n} \mid m,n \geq 1 \}\)
\(\{\left ( ab \right )^{n}\left ( cb^{n} \right )^{m} \mid m,n \geq 1 \}\)
Correct Answer : B
Question Type : MCQ
Max Marks : 1
Negative Marks : 0.33
Question : 21
Consider the C struct defined below:
struct data { int marks [100]; char grade; int cnumber; }; struct data student;
The base address of student is available in register R1. The field student.grade can be accessed efficiently using:
Post-increment addressing mode, (R1)+
Pre-decrement addressing mode, -(R1)
Register direct addressing mode, R1
Correct Answer : D
Question Type : MCQ
Max Marks : 1
Negative Marks : 0.33
Question : 22
Consider the following intermediate program in three address code
p = a - b q = p * c p = u * v q = p + q
Which one of the following corresponds to a static single assignment form of the above code?
p1 = a - b q1 = p1 * c p1 = u * v q1 = p1 + q1
p3 = a - b q4 = p3 * c p4 = u * v q5 = p4 + q4
p1 = a - b q1 = p2 * c p3 = u * v q2 = p4 + q3
p1 = a - b q1 = p * c p2 = u * v q2 = p + q
Correct Answer : B
Question Type : MCQ
Max Marks : 1
Negative Marks : 0.33
Question : 23
Consider the following C code:
#include<stdio.h> int *assignval (int *x, int val) { *x = val; return x; } void main () { int *x = malloc(sizeof(int)); if (NULL == x) return; x = assignval (x,0); if (x) { x = (int *)malloc(sizeof(int)); if (NULL == x) return; x = assignval (x,10); } printf("%d\n", *x); free(x); }
The code suffers from which one of the following problems:
compiler error as the return of malloc is not typecast appropriately.
compiler error because the comparison should be made as x == NULL and not as shown.
compiles successfully but execution may result in dangling pointer.
compiles successfully but execution may result in memory leak.
Correct Answer : D
Question Type : MCQ
Max Marks : 1
Negative Marks : 0.33
Question : 24
Consider a TCP client and a TCP server running on two different machines. After completing data transfer, the TCP client calls close to terminate the connection and a FIN segment is sent to the TCP server. Server-side TCP responds by sending an ACK, which is received by the client-side TCP. As per the TCP connection state diagram (RFC 793), in which state does the client-side TCP connection wait for the FIN from the server-side TCP?
LAST-ACK
TIME-WAIT
FIN-WAIT-1
FIN-WAIT-2
Correct Answer : D
Question Type : MCQ
Max Marks : 1
Negative Marks : 0.33
Question : 25
A sender \(S\) sends a message \(m\) to receiver \(R\), which is digitally signed by \(S\) with its private key. In this scenario, one or more of the following security violations can take place.
Which of the following are possible security violations?
I and II only
I only
II only
II and III only
Correct Answer : B
Question Type : MCQ
Max Marks : 1
Negative Marks : 0.33
Question : 26
The following functional dependencies hold true for the relational schema \(R\left \{V,W,X,Y,Z \right \}\):
V → W
VW → X
Y → VX
Y → Z
Which of the following is irreducible equivalent for this set of functional dependencies?
V → W
V → X
Y → V
Y → Z
V → W
W → X
Y → V
Y → Z
V → W
V → X
Y → V
Y → X
Y → Z
V → W
W → X
Y → V
Y → X
Y → Z
Correct Answer : A
Question Type : MCQ
Max Marks : 1
Negative Marks : 0.33
Question : 27
Consider the following grammar:
\(\begin{align*} p &\rightarrow xQRS \\ Q &\rightarrow yz|z \\ R &\rightarrow w|\varepsilon \\ S &\rightarrow y \\ \end{align*} \)
What is FOLLOW(\(Q\))?
\(\left \{ R \right \}\)
\(\left \{ w \right \}\)
\(\left \{ w,y \right \}\)
\(\left \{ w,$ \right \}\)
Correct Answer : C
Question Type : MCQ
Max Marks : 1
Negative Marks : 0.33
Question : 28
Threads of a process share
global variables but not heap
heap but not global variables
neither global variables nor heap
both heap and global variables
Correct Answer : D
Question Type : MCQ
Max Marks : 1
Negative Marks : 0.33
Question : 29
Let \(X\) be a Gaussian random variable with mean 0 and variance \(\sigma ^{2}\). Let \(Y\) = max(\(X\),0) where max(\(a,b\)) is the maximum of \(a\) and \(b\). The median of \(Y\) is ______________ .
Correct Answer : 0
Question Type : NAT
Max Marks : 1
Negative Marks : 0
Question : 30
Let \(T\) be a tree with 10 vertices. The sum of the degrees of all the vertices in \(T\) is ________
Correct Answer : 18
Question Type : NAT
Max Marks : 1
Negative Marks : 0
Question : 31
Consider the Karnaugh map given below, where \(X\) represents "don't care" and blank represents 0.
Assume for all inputs \(\left ( a,b,c,d \right )\), the respective complements \(\left ( \bar{a}, \bar{b}, \bar{c}, \bar{d} \right )\) are also available. The above logic is implemented using 2-input NOR gates only. The minimum number of gates required is ____________ .
Correct Answer : 1
Question Type : NAT
Max Marks : 1
Negative Marks : 0
Question : 32
Consider the language \(L\) given by the regular expression \((a+b)^{*} b (a+b)\) over the alphabet \(\{a,b\}\). The smallest number of states needed in a deterministic finite-state automaton (DFA) accepting \(L\) is ___________ .
Correct Answer : 4
Question Type : NAT
Max Marks : 1
Negative Marks : 0
Question : 33
Consider a database that has the relation schema EMP (EmpId, EmpName, and DeptName). An instance of the schema EMP and a SQL query on it are given below:
\(\overset{\text{EMP}}{\begin{array}{|c|c|c|}\hline\\ \textbf{EmpId}& \textbf{EmpName}& \textbf{DeptName}\\\hline 1& \text{XYA}& \text{AA} \\ \hline 2& \text{XYB}& \text{AA} \\ \hline 3& \text{XYC}& \text{AA} \\\hline 4& \text{XYD}& \text{AA} \\\hline 5& \text{XYE}& \text{AB} \\\hline 6& \text{XYF}& \text{AB} \\\hline 7& \text{XYG}& \text{AB} \\\hline 8& \text{XYH}& \text{AC} \\\hline 9& \text{XYI}& \text{AC} \\\hline 10& \text{XYJ}& \text{AC} \\\hline 11&\text{XYK} & \text{AD} \\\hline 12 & \text{XYL}& \text{AD} \\\hline 13 & \text{XYM} & \text{AE} \\\hline\end{array}}\)
SELECT AVG(EC.Num) FROM EC WHERE (DeptName, Num) IN (SELECT DeptName, COUNT(EmpId) AS EC(DeptName, Num) FROM EMP GROUP BY DeptName)
The output of executing the SQL query is _____________ .
Correct Answer : 2.6
Question Type : NAT
Max Marks : 1
Negative Marks : 0
Question : 34
Consider the following CPU processes with arrival times (in milliseconds) and length of CPU bursts (in milliseconds) as given below:
\(\small \begin{array}{|c|c|c|} \hline \textbf{Process} & \textbf{Arrival Time} & \textbf{Burst Time}\\\hline \text{$P_1$} & 0 & 7 \\\hline \text{$P_2$} & 3 & 3 \\\hline \text{$P_3$} & 5 & 5 \\\hline \text{$P_4$} & 6 & 2 \\\hline \end{array}\)
If the pre-emptive shortest remaining time first scheduling algorithm is used to schedule the processes, then the average waiting time across all processes is _____________ milliseconds
Correct Answer : 3
Question Type : NAT
Max Marks : 1
Negative Marks : 0
Question : 35
Consider a two-level cache hierarchy with L1 and L2 caches. An application incurs 1.4 memory accesses per instruction on average. For this application, the miss rate of L1 cache is 0.1; the L2 cache experiences, on average, 7 misses per 1000 instructions. The miss rate of L2 expressed correct to two decimal places is ________.
Correct Answer : 0.05 to 0.05
Question Type : NAT
Max Marks : 1
Negative Marks : 0
Question : 36
Let \(G=\left ( V,E \right )\) be \(any\) connected, undirected, edge-weighted graph. The weights of the edges in \(E\) are positive and distinct. Consider the following statements:
(I) Minimum Spanning Tree of \(G\) is always unique.
(II) Shortest path between any two vertices of \(G\) is always unique.
Which of the above statements is/are necessarily true?
I only
II only
both I and II
neither I nor II
Correct Answer : A
Question Type : MCQ
Max Marks : 2
Negative Marks : 0.67
Question : 37
A multithreaded program \(P\) executes with \(x\) number of threads and uses \(y\) number of locks for ensuring mutual exclusion while operating on shared memory locations. All locks in the program are non-reentrant, i.e., if a thread holds a lock \(l\), then it cannot re-acquire lock \(l\) without releasing it. If a thread is unable to acquire a lock, it blocks until the lock becomes available. The minimum value of \(x\) and the minimum value of \(y\) together for which execution of \(P\) can result in a deadlock are:
\(x = 1, y = 2\)
\(x = 2, y = 1\)
\(x = 2, y = 2\)
\(x = 1, y = 1\)
Correct Answer : D
Question Type : MCQ
Max Marks : 2
Negative Marks : 0.67
Question : 38
The value of \(\displaystyle \lim_{x\rightarrow 1} \frac{x^{7}-2x^{5}+1}{x^{3}-3x^{2}+2}\)
is 0
is -1
is 1
does not exist
Correct Answer : C
Question Type : MCQ
Max Marks : 2
Negative Marks : 0.67
Question : 39
Let \(p, q\) and \(r\) be propositions and the expression \(\left ( p\rightarrow q \right )\rightarrow r\) be a contradiction. Then, the expression \(\left ( r\rightarrow p \right )\rightarrow q\) is
a tautology
a contradiction
always TRUE when \(p\) is FALSE
always TRUE when \(q\) is TRUE
Correct Answer : D
Question Type : MCQ
Max Marks : 2
Negative Marks : 0.67
Question : 40
Let \(u\) and \(v\) be two vectors in \(\mathbf{R}^{2}\) whose Euclidean norms satisfy ‖\(u\)‖=2‖\(v\)‖. What is the value of \(\alpha\) such that \(w = u + \alpha v\) bisects the angle between \(u\) and \(v\)?
2
1/2
1
-1/2
Correct Answer : A
Question Type : MCQ
Max Marks : 2
Negative Marks : 0.67
Question : 41
Let \(A\) be \(n\times n\) real valued square symmetric matrix of rank 2 with \(\sum_{i=1}^{n}\sum_{j=1}^{n}A^{2}_{ij} = 50.\). Consider the following statements.
I. One eigenvalue must be in [−5,5]
II. The eigenvalue with the largest magnitude must be strictly greater than 5
Which of the above statements about eigenvalues of \(A\) is/are necessarily CORRECT?
Both I and II
I only
II only
Neither I nor II
Correct Answer : B
Question Type : MCQ
Max Marks : 2
Negative Marks : 0.67
Question : 42
A computer network uses polynomials over \(GF(2)\) for error checking with 8 bits as information bits and uses \(x^{3}+x+1\) as the generator polynomial to generate the check bits. In this network, the message 01011011 is transmitted as:
01011011010
01011011011
01011011101
01011011100
Correct Answer : C
Question Type : MCQ
Max Marks : 2
Negative Marks : 0.67
Question : 43
Consider a combination of T and D flip-flops connected as shown below. The output of the D flip-flop is connected to the input of the T flip-flop and the output of the T flip-flop is connected to the input of the D flip-flop.
Initially, both Q0 and Q1 are set to 1 (before the 1st clock cycle). The outputs
Q1Q0 after the 3rd cycle are 11 and after the 4th cycle are 00 respectively.
Q1Q0 after the 3rd cycle are 11 and after the 4th cycle are 01 respectively.
Q1Q0 after the 3rd cycle are 00 and after the 4th cycle are 11 respectively.
Q1Q0 after the 3rd cycle are 01 and after the 4th cycle are 01 respectively.
Correct Answer : B
Question Type : MCQ
Max Marks : 2
Negative Marks : 0.67
Question : 44
If \(G\) is a grammar with productions
\(S\rightarrow SaS\mid aSb\mid bSa\mid SS\mid\epsilon\)
where \(S\) is the start variable, then which one of the following strings is not generated by \(G\) ?
\(abab\)
\(aaab\)
\(abbaa\)
\(babba\)
Correct Answer : D
Question Type : MCQ
Max Marks : 2
Negative Marks : 0.67
Question : 45
Consider the following two functions.
The output printed when fun1(5) is called is
53423122233445
53423120112233
53423122132435
53423120213243
Correct Answer : A
Question Type : MCQ
Max Marks : 2
Negative Marks : 0.67
Question : 46
Consider the C functions foo and bar given below:
int foo(int val) { int x=0; while(val > 0) { x = x + foo(val--); } return val; }
int bar(int val) { int x = 0; while(val > 0) { x= x + bar(val-1); } return val; }
Invocations of foo(3) and bar(3) will result in:
Return of 6 and 6 respectively.
Infinite loop and abnormal termination respectively.
Abnormal termination and infinite loop respectively.
Both terminating abnormally.
Correct Answer : C
Question Type : MCQ
Max Marks : 2
Negative Marks : 0.67
Question : 47
Consider the context-free grammars over the alphabet \(\left \{ a, b, c \right \}\) given below. \(S\) and \(T\) are non-terminals.
\(G_{1}:S\rightarrow aSb \mid T, T \rightarrow cT \mid \epsilon\)
\(G_{2}:S\rightarrow bSa \mid T, T \rightarrow cT \mid \epsilon\)
The language \(L\left ( G_{1} \right )\cap L(G_{2})\) is
Finite
Not finite but regular
Context-Free but not regular
Recursive but not context-free
Correct Answer : B
Question Type : MCQ
Max Marks : 2
Negative Marks : 0.67
Question : 48
Consider the following languages over the alphabet \(\Sigma = \left \{ a, b, c \right \}\). Let \(L_{1} = \left \{ a^{n}b^{n}c^{m}\mid m,n \geq 0 \right \}\) and \(L_{2} = \left \{ a^{m}b^{n}c^{n}\mid m,n \geq 0 \right \}\).
Which of the following are context-free languages?
I. \(L_{1} \cup L_{2}\)
II. \(L_{1} \cap L_{2}\)
I only
II only
I and II
Neither I nor II
Correct Answer : A
Question Type : MCQ
Max Marks : 2
Negative Marks : 0.67
Question : 49
Let \(A\) and \(B\) be finite alphabets and let # be a symbol outside both \(A\) and \(B\). Let \(f\) be a total function from \(A^*\) to \(B^*\). We say \(f\) is computable if there exists a Turing machine \(M\) which given an input \(x\)∈\(A^*\), always halts with \(f(x)\) on its tape. Let \(L_f\) denote the language \(\Bigl \{x\# f(x) \mid x\in A^{*} \Bigr \}\). Which of the following statements is true:
\(f\) is computable if and only if \(L_f\) is recursive.
\(f\) is computable if and only if \(L_f\) is recursively enumerable.
If \(f\) is computable then \(L_f\) is recursive, but not conversely.
If \(f\) is computable then \(L_f\) is recursively enumerable, but not conversely.
Correct Answer : A
Question Type : MCQ
Max Marks : 2
Negative Marks : 0.67
Question : 50
Recall that Belady's anomaly is that the page-fault rate may increase as the number of allocated frames increases. Now, consider the following statements:
\(S1\): Random page replacement algorithm (where a page chosen at random is replaced) suffers from Belady's anomaly.
\(S2\): LRU page replacement algorithm suffers from Belady's anomaly.
Which of the following is CORRECT?
\(S1\) is true, \(S2\) is true
\(S1\) is true, \(S2\) is false
\(S1\) is false, \(S2\) is true
\(S1\) is false, \(S2\) is false
Correct Answer : B
Question Type : MCQ
Max Marks : 2
Negative Marks : 0.67
Question : 51
Consider a database that has the relation schemas EMP(EmpId, EmpName, DeptId), and DEPT(DeptName, DeptId). Note that the DeptId can be permitted to be NULL in the relation EMP. Consider the following queries on the database expressed in tuple relational calculus.
I. {\(t\) | ∃u ∈ EMP(t[EmpName] = u[EmpName] ∧ ∀v ∈ DEPT(t[DeptId] ≠ v[DeptId]))}
II. {\(t\) | ∃u ∈ EMP(t[EmpName] = u[EmpName] ∧ ∃v ∈ DEPT(t[DeptId] ≠ v[DeptId]))}
III. {\(t\) | ∃u ∈ EMP(t[EmpName] = u[EmpName] ∧ ∃v ∈ DEPT(t[DeptId] = v[DeptId]))}
Which of the above queries are safe?
I and II only
I and III only
II and III only
I, II and III
Correct Answer : D
Question Type : MCQ
Max Marks : 2
Negative Marks : 0.67
Question : 52
In a database system, unique timestamps are assigned to each transaction using Lamport's logical clock. Let \(TS(T_1)\) and \(TS(T_2)\) be the timestamps of transactions \(T_1\) and \(T_2\) respectively. Besides, \(T_1\) holds a lock on the resource \(R\), and \(T_2\) has requested a conflicting lock on the same resource \(R\). The following algorithm is used to prevent deadlocks in the database system assuming that a killed transaction is restarted with the same timestamp.
if \(TS(T_2)\) < \(TS(T_1)\) then
\(T_1\) is killed
else \(T_2\) waits.
Assume any transaction that is not killed terminates eventually. Which of the following is TRUE about the database system that uses the above algorithm to prevent deadlocks?
The database system is both deadlock-free and starvation-free.
The database system is deadlock-free, but not starvation-free.
The database system is starvation-free, but not deadlock-free.
The database system is neither deadlock-free nor starvation-free.
Correct Answer : A
Question Type : MCQ
Max Marks : 2
Negative Marks : 0.67
Question : 53
Consider the following grammar:
stmt → if expr then expr else expr; stmt | Ò
expr → term relop term | term
term → id | number
id → a | b | c
number →[0−9]
where relop is a relational operator (e.g., <,>,…), Ò refers to the empty statement, and if, then, else are terminals.
Consider a program \(P\) following the above grammar containing ten if terminals. The number of control flow paths in \(P\) is________ . For example. the program
if e1 then e2 else e3
has 2 control flow paths. e1→e2 and e1→e3.
Correct Answer : 1024
Question Type : NAT
Max Marks : 2
Negative Marks : 0
Question : 54
In a RSA cryptosystem, a participant A uses two prime numbers p = 13 and q = 17 to generate her public and private keys. If the public key of A is 35, then the private key of A is __________ .
Correct Answer : 11
Question Type : NAT
Max Marks : 2
Negative Marks : 0
Question : 55
The values of parameters for the Stop-and-Wait ARQ protocol are as given below:
Assume there are no transmission errors. Then, the transmission efficiency (expressed in percentage) of the Stop-and-Wait ARQ protocol for the above parameters is _____________ (correct to 2 decimal places).
Correct Answer : 86.5 to 89.5
Question Type : NAT
Max Marks : 2
Negative Marks : 0
Question : 56
Consider a database that has the relation schema CR(StudentName, CourseName). An instance of the schema CR is as given below.
\(\begin{array}{|c|c|} \hline \textbf{StudentName} & \textbf {CourseName} \\\hline \text {SA} & \text{CA} \\\hline \text{SA} & \text{CB}\\\hline \text{SA} & \text{CC} \\\hline \text{SB} & \text{CB} \\\hline \text{SB}& \text{CC} \\\hline \text{SC} & \text{CA}\\\hline \text{SC}&\text{CB} \\\hline \text{SC} & \text{CC} \\\hline \text {SD} & \text{CA} \\\hline \text{SD} & \text{CB}\\\hline \text{SD} & \text{CC} \\\hline \text{SD} & \text{CD} \\\hline \text{SE}& \text{CD} \\\hline \text{SE} & \text{CA}\\\hline \text{SE}&\text{CB} \\\hline \text{SF}& \text{CA} \\\hline \text{SF} & \text{CB }\\\hline\text{SF} & \text{CC} \\\hline \end{array}\)
The following query is made on the database.
\(T1 \leftarrow \pi _{CourseName}\left ( \sigma _{StudentName=SA}\left ( CR \right ) \right )\)
\(T2 \leftarrow CR\div T1\)
The number of rows in \(T2\) is ______________ .
Correct Answer : 4
Question Type : NAT
Max Marks : 2
Negative Marks : 0
Question : 57
The number of integers between 1 and 500 (both inclusive) that are divisible by 3 or 5 or 7 is ____________ .
Correct Answer : 271
Question Type : NAT
Max Marks : 2
Negative Marks : 0
Question : 58
Let \(A\) be an array of 31 numbers consisting of a sequence of 0's followed by a sequence of 1's. The problem is to find the smallest index \(i\) such that \(A[i]\) is 1 by probing the minimum number of locations in \(A\). The worst case number of probes performed by an optimal algorithm is ____________.
Correct Answer : 5
Question Type : NAT
Max Marks : 2
Negative Marks : 0
Question : 59
Consider a RISC machine where each instruction is exactly 4 bytes long. Conditional and unconditional branch instructions use PC-relative addressing mode with Offset specified in bytes to the target location of the branch instruction. Further the Offset is always with respect to the address of the next instruction in the program sequence. Consider the following instruction sequence
\(\begin{array}{ll} \text{Instr. No.} & \text{Instruction} \\\hline \text{i:} & \text{add R2, R3, R4} \\ \text{i+1:} & \text{sub R5, R6, R7} \\ \text{i+2:} & \text{cmp R1, R9, R10} \\ \text{i+3:} & \text{beq R1, Offset} \\ \end{array}\)
If the target of the branch instruction is \(i\), then the decimal value of the Offset is ____________ .
Correct Answer : -16
Question Type : NAT
Max Marks : 2
Negative Marks : 0
Question : 60
Instruction execution in a processor is divided into 5 stages, Instruction Fetch (IF), Instruction Decode (ID), Operand fetch (OF), Execute (EX), and Write Back (WB). These stages take 5, 4, 20, 10 and 3 nanoseconds (ns) respectively. A pipelined implementation of the processor requires buffering between each pair of consecutive stages with a delay of 2 ns. Two pipelined implementation of the processor are contemplated:
I. a naive pipeline implementation (NP) with 5 stages and
II. an efficient pipeline (EP) where the OF stage is divided into stages OF1 and OF2 with execution times of 12 ns and 8 ns respectively.
The speedup (correct to two decimal places) achieved by EP over NP in executing 20 independent instructions with no hazards is _________ .
Correct Answer : 1.49 to 1.52
Question Type : NAT
Max Marks : 2
Negative Marks : 0
Question : 61
Consider a 2-way set associative cache with 256 blocks and uses LRU replacement. Initially the cache is empty. Conflict misses are those misses which occur due to the contention of multiple blocks for the same cache set. Compulsory misses occur due to first time access to the block. The following sequence of access to memory blocks :
{0,128,256,128,0,128,256,128,1,129,257,129,1,129,257,129}
is repeated 10 times. The number of conflict misses experienced by the cache is _________ .
Correct Answer : 76
Question Type : NAT
Max Marks : 2
Negative Marks : 0
Question : 62
Consider the expression \((a-1) * (((b+c)/3)+d)\). Let \(X\) be the minimum number of registers required by an optimal code generation (without any register spill) algorithm for a load/store architecture, in which
The value of \(X\) is _____________ .
Correct Answer : 2
Question Type : NAT
Max Marks : 2
Negative Marks : 0
Question : 63
Consider the following C program.
#include<stdio.h> #include<string.h> void printlength(char *s, char *t) { unsigned int c=0; int len = ((strlen(s) - strlen(t)) > c) ? strlen(s) : strlen(t); printf("%d\n", len); } void main() { char *x = "abc"; char *y = "defgh"; printlength(x,y); }
Recall that strlen is defined in string.ℎ as returning a value of type size_t, which is an unsigned int. The output of the program is __________ .
Correct Answer : 3
Question Type : NAT
Max Marks : 2
Negative Marks : 0
Question : 64
A cache memory unit with capacity of \(N\) words and block size of \(B\) words is to be designed. If it is designed as a direct mapped cache, the length of the TAG field is 10 bits. If the cache unit is now designed as a 16-way set-associative cache, the length of the TAG field is ____________ bits.
Correct Answer : 14
Question Type : NAT
Max Marks : 2
Negative Marks : 0
Question : 65
The output of executing the following C program is _______________ .
#include<stdio.h> int total(int v) { static int count = 0; while(v) { count += v&1; v >>= 1; } return count; } void main() { static int x=0; int i=5; for(; i>0; i--) { x = x + total(i); } printf("%d\n", x); }
Correct Answer : 23
Question Type : NAT
Max Marks : 2
Negative Marks : 0