Professional Documents
Culture Documents
Cs Pre Gate 2020
Cs Pre Gate 2020
Cs Pre Gate 2020
05. How many one-rupee coins, 50 paise (A) Critical reading is a slow, dull but
coins, 25 paise coins in total of which the essential process.
numbers are proportional to 5, 7 and 12 are (B) The best critical reading happens at
together work ₹115? critical times in a person’s life.
(C) Readers should get in the habit of
(A) 50, 70, 120
questioning the truth of what they read.
(B) 60, 70, 110
(D) Critical reading requires thoughtful
(C) 70, 80, 90
and careful attention.
(D) None of these
06. Ans: (D)
05. Ans: (A)
Sol: Choice (A) is incorrect because the author
Sol: (51+70.5+120.25) x = 115 never says that reading is dull.
(5+3.5+3)x = 115 Choice (B) and (C) are not supported by
11.5x = 115 the paragraph.
x = 10 Choice (D) is correct as it is implied in the
entire passage.
Number of one rupee coins
= 5x = 510 = 50 07. Anil’s house faces east from the back-side
Number of 5-paise coins of the house, he walks straight 50 metres,
= 7x = 710 = 70 then turns to the right and walks 50m again
Number of 25-paise coins finally, he turns towards left and stops after
= 12x = 1210 = 120 walking 25m. Now Anil is in which
direction from the starting point?
06. Critical reading is a demanding process. (A) South-east (B) South-west
To read critically, you must slow down (C) North-east (D) North-west
your reading and with pencil in hand, 07. Ans: (D)
perform specific operations on the text, Sol: The movement of Anil are shown in the
mark up the text with your reactions, adjoining figure
25m
conclusions, and questions, then you read, D C
Profit of A 2
The sum lent at 12% = 25400
5
160 160
= 254 254 = ₹80
160 153 196 509 = ₹10160.
10. The following question is to be answered (A) SELECT loan_number FROM loan
on the basis of the table given below. GROUP BY amount;
(B) SELECT loan_number FROM loan
Number of Number of
Category of SORT BY amount;
staff in the staff in the
personnel
year-1990 year-1995
(C) SELECT loan_number FROM loan
Data
18 25
preparation ORDER BY amount ASCENDING;
Data control 5 8
(D) SELECT loan_number FROM loan
Operators 18 32
ORDER BY amount;
Programmers 21 36
11. Ans: (D)
Analysts 15 31
Sol: The ORDER BY clause is used to sort list
Managers 3 3
items in ascending order by default. We
Total 80 135
also use DSC or ASC to sort the values in
What is the increase in the sector angle for descending or ascending order
operators in the year 1995 over the sector respectively.
angle for operators in the year 1990? Options (A) and (B) are incorrect since
(A) 4 (B) 3 (C) 2 (D) 1 option (B) generates the error message,
10. Ans: (A) SQL command not properly ended since
Sol: Sector angle for operators in the year 1990 SORT BY is not valid for this.
18 Option (A) also generates error message,
360 81
80
not a GROUP BY expression.
Sector angle for operator in the year 1995
So options (A), (B) and (C) are incorrect.
32
360 = 85.33 ≃ 85%
135
12. Let L1, L2, L3 be three languages
∴Required difference = 85– 81= 4
L1 = {an bn cm | m, n 1}
L2 = {an bm cm | m, n 1}
11. Which is the correct SQL command to
L3 = {an bn cn | n 1}
display the loan numbers of the customers
in ascending order of their loan amounts.
Choose the correct answer
Primary key is underlined in the schema.
(A) L1 L3 (B) L2 L3
loan(loan_number, branch_name, amount)
(C) L1 L2 (D) L3 L1
ACE Engineering Academy Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar|Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag|Tirupati|Kukatpally|Kolkata|Ahmedabad
: 6 : PRE‐GATE_2020
2 1 1 AB A[B B]
0 1 0 0
AB A [B B 1]
1 1 2
A AB
= 1, 1, 3
AB [ x x y x y]
S1 is not true
f AB =two input NAND Gate
For = 1, the eigen vectors are given by
(A – I) X = 0 A f AB
x+y+z=8 B
19. Ans: (B) 21. Match List-I (types of cache misses) with
List-II (solution to reduce miss of specific
sin cos d
4 4
Sol:
0
type)
List-I List-II
sin cos d
4 4
p. Conflict miss 1. Increase cache size
2 0
q. Capacity miss 2. Increase block size
a a
0 x f x dx 2 0 f x dx
a
r. Compulsory miss 3. Increase associativity
Codes
/2
p q r
sin 4 cos 4 d
0 (A) 1 2 3
(B) 2 3 1
2a f x dx 2 a f x dx if f 2a x f x
0 0 (C) 3 2 1
(D) 3 1 2
(3.1) 3.1 21. Ans: (D)
By Reduction formula
8 .6 .4 .2 2
3 2 22. 127.0.127.195 is a
=
256 (A) Limited Broadcast Address
(B) Direct Broadcast Address
20. Choose the wrong statement (C) Multicast Address
(A) the class of all formal languages is (D) Loop Back Address
24. Consider an open statement P(x, y): (y – x (A) S1 and S2 (B) S2 and S3
2
= y + x ) where the universe of discourse is (C) S3 and S4 (D) S1 and S4
set of all real numbers. Consider the 24. Ans: (C)
following statements. Sol: S1 is false. For example when x=1, there
S1: x y P(x, y) exists no integer y which makes S1 true
S2: y x P(x, y) S2 is false. For example when x=1, there
value true?
25. The minimum number of 2-input NAND, NOR Gates required to Design a Half substractor
respectively are
(A) 4, 4 (B) 4, 5
(C) 5, 5 (D) 5, 4
25. Ans: (C)
Sol: A Difference [D]=AB
Half subtractor
B Borrow [B]= A B
AB AB =AB=Difference
A AB
B
A B=Borrow
B.AB
Hence 5 NAND Gates are required
Using NOR:
A A B A B Borrow
A AB AB AB =AB=Difference
B
is performed between these reduced data- draw an edge between the corresponding
sets and finally empname and deptname vertices. Now, there would be a graph with
attributes are obtained by project 15vertices and degree of each vertex 3.
operation. Hence option (D) is the correct By sum of degree theorem, such a graph
option that follows the said process of does not exist.
optimization. S2 is false.
For 7’s [r–1] complement subtract each bit Step1: Assume that Base address of array
of a given number from 7[r–1] is 100 and integer occupies ‘2’ bytes.
7 7 7 7 7 7 Array name always holds base address of
N= 3 0 5 7 0 0 array
7’s complement of N = 4 7 2 0 7 7 Step2: P = a+5 means
For 8’s [r] complement, write zero bits as P = 100+(52)
it is then subtract 1st Non zero LSB bit P = 110
from 8[r] and remaining bits from 7[r–1] Now ‘P’ is pointing to the address 110
7 7 7 8 Step3: Now P[–2] value is 40
N= 3 0 5 7 0 0 and 3[a] value is 40
so the result of P[–2] + 3[a]
as it is
8’s complement of N = 4 7 2 1 0 0 = 40 + 40 = 80
30. void main() 31. Let S = Set of all +ve integers. The
int a[10] = {10, 20, 30, 40, 50, 60, 70, subset of S with m elements contain atleast
P = a+5; is_________.
The output of the above program divide only +ve integer with 10 the
32. Assume that for a certain processor a read 34. Consider the following DAG
request takes 16 nanoseconds as average *
memory access time. A read request which –
causes cache hit, takes 10nsec and a read +
4-way set Fully Step2: First call abc (&x, y); passing
Direct
associative associative Global variable ‘x’ address and Global
Mapping
mapping mapping variable ‘y’ value.
Tag size Tag size Tag size In called function, the formal
= 15-bits = 17-bits = 27-bits parameter ‘P’ is holding address of
Global variable ‘x’ and formal
15-bit tag 17-bit tag 27-bit tag
parameter ‘x’ is holding value of
comparator comparator comparator
global variable ‘y’
Step3: x = *P + y means x = 5 + 6
37. int x, y;
Local variable x = 11 and
void abc (int *P, int x)
y = x+ *P means y = 11 + 5
{ Global variable y = 16
x = *P + y; Step4: printf(“%d”, y) will print global
y = x + *P; variable value as 16.
} Step5: Second call abc(&x, y); passing
void main()
global ‘x’ address and global ‘y’
{
variable value.
x = 5;
Step6: x = *P + y means x = 5+16
y = 6;
local variable x = 21
abc (&x, y);
y = x + *P means y = 21+5
printf(“%d”, y);
y = 26
abc(&x, y);
Step 7: printf(“%d”, y) prints result as 26
printf(“%d”, y);
} The output is 16, 26
What is the output of the above program?
(A) 16, 26 (B) 16, 16 38. Construct the LALR(1) sets of items for
(C) 10, 20 (D) 10, 10 the grammar:
S → SS + | a
37. Ans: (A)
Then, identify, in the list below, one of the
Sol: Step1: From main(), we assigned global
“LALR(1) sets of items” for this grammar.
variables x, y values as 5,6 respectively. (A) [S→SS+., $|+] (B) [S→a.,+|a]
x 5 y 6 (C) [S→a., $|a] (D) [S→a., $|+|a]
39. Consider the following code on Binary tree If the invocation is Do(a, 0, t) on the above
tree, then the following values of array are
void Do(int a[ ], int level, BTNode *t) displaced. Choose the correct option
{
if (!t)
(A)
return;
0 1 2 3
a[level] + = t → data ;
a 0 0 0 0
Do(a, level+1, t → left);
Do(a, level+1, t→Right);
} 0 1 2 3
(B)
t → 15 a 15 30 25 20
10 30
25 (C)
5
0 1 2 3
20
a 15 20 30 40
Initial values of array
0 1 2 3
(D)
a 0 0 0 0
0 1 2 3
a 15 40 30 20
0 1 2 3 10 30
15 0 0 0
+10
+30
0 1 2 3
15 40 0 0 5 25
+5
+25
0 1 2 3
20
15 40 30 0
+20
40. Two computers A & B are configured as follows A has IP Address 200.197.17.157 and net mask
255.255.128.0. B has IP address 200.192.192.201 and Net mask 255.255.192.0. Which one of the
following statement is True?
(A) A and B both assume they are on same network.
(B) B assume A is on same network but A assume B is on different network.
(C) A assume B is on same network, B assume A is on different network.
(D) A and B both assume they are on different network
42. The probability that a process spends its T2 reads the value written by T1 and is
time in performing I/O operations is ‘P’. In committing after T1 then the schedule is
a multi programmed O.S environment, if recoverable and also cascading rollbacks
there are ‘n’ processes in memory at once, possible, if T1 fails just before it commits
then the probability that all processes are need to rollback both T1 and T2.
waiting for I/O & the systems utilization is
respectively 44. Match the following:
n n n
(A) 1/P, P (B) P , 1–P OSI Layer
(C) P, Pn (D) 1/Pn, 1–Pn 1. Network Layer
42. Ans: (B) 2. Transport Layer
Sol: The probability that all processes goes for 3. Data Link layer
I/O is P*P*..*P for n processes i.e Pn 4. Session Layer
Hence the Probability of CPU Utilization 5. Physical Layer
n
will be 1–P
Responsibility
43. Consider the following schedule P. Transmission mode
R1(A), W1(A), R2(A), W2(A), R1(B), Q. Feed back Message
W1(B), C1, R2(B), W2(B), C2 R. Segmentation & Reassembly
(i) Schedule is conflict serializable S. Dialog Control
(ii) Schedule is recoverable T. Access Control
(iii) Schedule is Cascade less
(A) (i) only Codes
(B) (i) and (ii) only 1 2 3 4 5
(C) (ii) and (iii) only (A) Q P T S R
(D) (i), (ii), and (iii) (B) Q R T S P
43. Ans: (B) (C) Q R T P S
Sol: The precedence graph for the schedule do (D) Q R P T S
not have cycles and the schedule is conflict
serializable.
MTU
6980 20 =1200
11765
735 Offset
8
1120 Total
Length
h(n) = n!
55. Consider the languages
which of the following is True?
2
56. Let L1= {0n+m 1n 0m | n, m > 0}, L2 and L3 are not CFLs
n+m n+m m
L2 = {0 1 0 | n, m > 0} and L1 {0n m 1n 0m | n , m 0} is DCFL, so CFL.
L3 = {0n+m 1n+m 0n+m | n, m > 0}
Which of these languages are NOT Push Pop Pop
context free? 0' s 0' s 0' s
L2 ={0 1 0 | n, m>0} = {0i 1i 0j | i >
n+m n+m m
(A) L1, L2 only (B) L1, L3 only
j, i, j>0} is not CFL
(C) L2, L3 only (D) L3 only
L3 = {0n+m 1n+m 0n+m | n, m>0} = {0k 1k 0k |
56. Ans: (C)
k>1} is not CFL
Sol: L1 is CFL
1
J1 Q1 J2 Q2 J3 Q3
K1 K2 K3 Q3
Clock
J K Qn+1 1 1 1 0 0 0 0 1 0 0
0 0 Qn 2 1 1 1 1 0 1 0 1 0
0 1 0 3 1 1 0 0 0 0 1 1 0
1 0 1 4 1 1 1 1 1 1 0 0 1
1 1 Qn 5 1 1 0 0 0 0 1 0 1
{b} 2 1* Do(P+1);
printf(“%c”, P[0]);
{b,g} 3 2* 1* 3 5 9
}
{b,g,c} 3* 2* 1* 3 5 9
void main()
{b,g,c,a} 3* 2* 1* 3* 5 8
{
{b,g,c,a,d} 3* 2* 1* 3* 5* 8
Do(“ab”);
{b,g,c,a,d,e} 3* 2* 1* 3* 5* 6*
}
{b,g,c,a,d,e,f} 3* 2* 1* 3* 5* 6* In the above program,
The number of times printf statement will
Shortest path cost from ‘b’ to ‘f’ is ‘6’ be executed is _________.
and we can have path as b →g→e→f
62. Ans: 4
Sol:
main() ‘a’ ‘b’ ‘\0’
100 101 102
Do(100)
pf(a)
Do(101) Do(101)
Do(101)
pf(b) pf(b)
Do(102) Do(102) Do(102) pf(b)
Do(102) Do(102) Do(102) Do(102) Do(102) Do(102)