Professional Documents
Culture Documents
Gate 2023 Cs PDF New 29
Gate 2023 Cs PDF New 29
com
1
byjusexamprep.com
2021
S.No. Subject Name 2023 2022
Set-1 Set-2
1 Databases 5 7 8 8
2 Operating Systems 9 10 6 7
3 Discrete Mathematics 9 11 6 6
4 Digital Logic 8 3 6 5
5 Computer Networks 8 10 12 7
6 Computer Organization 7 9 5 8
7 Data Structures & Programming 10 10 8 9
8 Algorithm 6 7 13 9
9 Theory of Computation 9 8 8 11
10 Compiler Design 7 4 7 8
11 Engg. Mathematics 7 6 6 7
12 General Aptitude 5 15 15 15
Total 100 100 100 100
2
byjusexamprep.com
3
byjusexamprep.com
Section – B (Technical)
answer be similar to the meaning of the Query: Select * from student where age
> 65 and gender = ‘F’;
word kind. Kind is an adjective. It has two
meanings (i) Nice, (ii) Type. Kindly can be
4
byjusexamprep.com
Student Table: Number of records = 25000
Block size = 1024 Byte
Roll Name Gender Marks
Key size = 15 Byte
No.
1 A M 65 Block pointer size = 5 Byte
= 51
=6+1
=7
8. Consider the following statements
S1: Front end of the compiler is
independent to hardware.
S2: Back end is specific to target
hardware.
S3: Back end is specific to programming
language.
A. S1 only B. S2 & S3
[NAT - 2 Marks] C. S3 only D. S1 & S2 only
Ans. 7 [MCQ - 1 Marks]
Sol. Given, Ans. D
5
byjusexamprep.com
Sol. Front end of the compiler means the
phases of the compiler completely
depends on source language and
independent on target machine.
Backend of the compiler means the
phases of the compiler completely
depends on the target machine and
independent on source language.
9.
11.
int foo ()
{
static int x = 1;
x++;
Parent value 1 < children values 12, 7.
return (x);
It’s not max-heap.
}
Option B :
main()
{
int x, y
x = foo();
y = foo() + x;
printf (x + y);
}
It satisfy both properties. What is the output of above code ?
Hence, It is max-heap. [NAT - 2 Marks]
Option C: Ans. 7
Sol. Program Execution starts from main()
function.
7
byjusexamprep.com
12. main() function. then all other function
int main() calls made in it will be represented as
{ child nodes.
f1(); The functions, in which recursion is not
f2(2); happening, they are represented as Leaf
f3(); nodes.
return 0;
} 13. Which of the following will guarantee the
computer system transition from user
8
byjusexamprep.com
for longer time. Hence, It could cause • 218 pages, page table size = 218
starvation. PTE’s * 8 bytes = 221 bytes …(4)
c) Priority policy also may cause low • 221 bytes table is divided into
priority processes to wait. So, 221
= 29 pages.
starvation possible. 212
d) In round robin, as CPU time is shared 29 pages, page table size = 29 * 8
to all processes, no process starve. bytes = 212 bytes …(5)
Hence, It can be stored in one frame of
15. Consider a computer system with 57 bit main memory.
virtual address using multilevel page So, number of levels of paging, L = 5
tables with L levels for virtual to Physical
address translation. The page size is 4 KB
16. What need to be stored during context
and page table entry at any of the levels
occupy 8 bytes. What is the value of L ? switch of threads (T1) to (T2)
[NAT - 2 Marks] A. PC
Ans. 5 B. Stack register
Sol. C. General purpose register
D. Base address of table
[MSQ - 1 Mark]
Ans. A,B,C
Sol. While switching from one thread to
• Page table size another, program counter value, stack
= No. of PTE’s * PTE size register value and GPR values for local
= 245 * 8 bytes = 248 bytes …(1) variables are stored in memory. Base
• To store 248 bytes page table, No. of address will not stored in memory.
248 B
pages required = = 236
212 B 17. 8-way set associative cache of bytes, 64
236 pages, page table size KB (1 KB = 1024 bytes) is used in a
230
12
= 218 Pages.
2
9
byjusexamprep.com
delay and no other hazards. Assume 1 010, 0110, …., which are not accepted by
instruction is fetched in every cycle. The DFA.
total execution time for 100 instruction is Option D: 1(110*)*, Here we don’t get
_______ ns.
strings like 1011 …….
[NAT - 2 Marks]
Ans. 2040 ns
21. Which is true?
Sol. Each cycle has max(10, 20, 14) ns which
A. Recursive language ∩ Recursive
is 20 n.s.
language = Recursive language
Total cycles = (k + n – 1) × 1 cycle B. Regular ∩ Regular = Regular
Here K = 3 [Number of stages] C. REL ∩ REL = REL
n = Number of instruction D. CFL ∩ CFL = CFL
combinations of letters and digits. Sol. • If link length is more, then the
It is equivalent to (a + b)+ 26. F(x) = x3 + 15x2 - 33x - 36
[MSQ - 1 Mark]
A. F(x) has local minima
24. The utilization of stop and wait protocol
will be low if B. F(x) does not have local minima
A. If link length is high and transmission C. F(x) has local maxima
rate is low D. F(x) does not have local maxima
B. If link length is low and transmission Ans. A, C
rate is low
Sol. F(x) = x3 + 15x2 – 33x – 36
C. If link length is high and transmission
F’(x) = 3x2 + 30x – 33
rate is high
D. If link length is low and transmission F’(x) = 0 ⇒ x2 + 10x – 11 = 0 ⇒ x = 1, –
11
byjusexamprep.com
F”(x) = 6x + 30
29. In an experiment, two fair coins are
At x = 1: F”(1) = 36 > 0 ⇒ f has local
tossed. Let A be the event that denotes
minimum
HEAD on both throw, B event denotes
At x = –11: F” (–11) = –36 < 0 ⇒ has HEAD on first throw and C event denotes
local maximum HEAD on second throw. Which of the
∴ So, option A and C are true. following is/are true?
A. A and C are independent
3 2 1 B. B and C are independent
( 4x ) dzdydx
2 3
27. y−z C. A and B are independent
−3 −2 −1
D. P(B/C) = P(B)
[NAT – 1 Mark] [MCQ - 2 Marks]
3 2 1 Ans. B, D
( 4x )
2
Sol. I= y − z3 dzdydx
Sol. Sample space, = {HH, HT, TH, TT}
−3 −2 −1
1
= A = HH p(A) =
4
3 2 1 3 2 1
2 3 1 1 1
4x y dzdydx − 2 dzdydx B = H_ = HT or HH p(B) = + =
−3 −2 −1 −3 −2 −1 4 4 2
y is odd function odd function 1 1 1
C = _H = TH or HH p(c) = + =
4 4 2
So, integral is 0 A & B HH
So, integral is 0 A & C HH
=0–0=0 B & C HH
[MCQ – 1 Mark]
A. |A| = |B|
B. |AB| = |A| + |B| Which state does not occur
C. |B| = –|A| A. 1, 1, 1 B. 1, 0, 0
C. 1, 0, 1 D. 0, 0, 1
D. |A| = 0
[MCQ - 2 Marks]
Ans. C
Ans. D
1 2 3 4 3 4 1 2
Sol. (0,0,1)
4 1 2 3 4 1 2 3
Sol. A = B=
3 4 1 2 1 2 3 4
2 3 4 1 2 3 4 1
Clearly A R1 R3 B
12
byjusexamprep.com
If Q2 = 1 Toggle Q3 Q R
30 / 5 6 0
6 /5 1 1
1/5 0 1
Ans: (110)5
[MCQ - 1 Mark]
n n
1 + 5 1 − 5
So, (0, 0, 1) does not occur A. Ln = +
2 2
n n
1 + 5 1 − 5
C. Ln = −
2 3
n n
1 + 5 1 − 5
D. Ln = +
2 3
32. (132)4 = (?)5 then find the value in radix 34. Consider this graph and it is represented
5 _______. by adjacency matrix. Let λ1, λ2….λ5 are
[NAT - 1 Marks] eigen values of A. Then λ1 + λ2 + λ3 + λ4 +
Ans. 110 λ5 =
13
byjusexamprep.com
14
byjusexamprep.com
B. Number of colors used is atmost Δ(G) A. ∃x[P(x) ⋀∀y Q(x, y)
+1 B. ∃x[P(x) ⋀∃y Q(x, y)
C. Number of colors used is atmost Δ(G) C. ∃y ∀x[P(x) ⇒ Q(x, y)
D. This procedure is result in proper D. ∀x ∀y Q(x, y)
vertex coloring Ans. C and D
Ans. A, B and D Sol. Option C: ∃y ∀x[P(x) ⇒ Q(x, y)]
Sol. The given procedure is to do vertex during Use the rule ∃y ∀x A(x, y) ⇒ ∀x ∃y A(x, y)
of a graph. So, option C implied ∀x[P(x) ⇒ ∃y Q(x, y)]
So, number of colors used is chromatic Option D: ∀x ∀y Q(x, y)
number. ∀x ∀y Q(x, y) is true
By chromatic number properties, ⇒ ∀x ∀y P(x) ⇒ Q(x, y) is true
No. of colors used is atmost Δ(G) + 1 ⇒ ∀x [P(x) ⇒ ∃y 2(x, y)] is true
∴ Option A, B and D are true.
40. Consider the following Pseudo code.
38. Let f & g is function of natural number f(n) Fun. 1 Fun. 2
= n and g(n) = n2 then which statement While n > 1 do for i = 1 to 100n do
is true for i = 1 to n x=x+1
[MCQ – 1 Mark] x=x+1 end for
A. f ϵ Ω(g) B. f ϵ O(g) end for
C. f ϵ θ(g) D. f ϵ o(g) n
n=
Ans. B and D 2
Sol. A. Ω(g(n)) = Ω(n2) set of all functions end while
which are asymptotically ≥ n2 [MSQ – 2 Marks]
B. O(g(n)) = O(n2) set of all functions A. f1 ϵ O(f2) B. f1 ϵ θ(f2)
which are asymptotically ≤ n 2
C. f1 ϵ ω(f2) D. f1 ϵ o(f2)
f = O(g(n)) is true Ans. C
C. θ(g(n)) = θ(n ) set of all functions
2
Sol. Option A: O(f2) = O(n) set of all functions
which are asymptotically ≈ n 2
which are asymptotically ≤ n.
D. o(g(n)) = o(n ) set of all functions
2
f1 = θ (f2) is false.
which are asymptotically <n 2
Option B: θ(f2) = θ(n) set of all function
f = o(g(n)) is true which are asymptotically ≈ n
f1 = θ(f2) is false
39. Geetha has a conjecture about integers Option C: ω(f2) = ω(n) = set of all
which is of the form ∀x [P(x) ⇒ ∃yQ(x, y)], function which are asymptotically > n
where P is a statement about integers and f1 = ω(f2(n)) true
Q is a statement about pairs of integers. o(f2) = o(n) = set of all functions which
Which of the following (one or more) are < n
option would imply Geetha’s conjecture. f1 = 0(f2) is true
[MSQ, 2 Marks]
15
byjusexamprep.com
41. A priority queue, implementation using B. O(1), O(n)
max heap. Extract-max (A) = Extract and C. O(1), O(logn)
delete the max elements, Insert (A, key) D. O(1), O(1)
- Insert-key in A. Then, [Note: properties Ans. A
of heap should be maintained at end of Sol. Extract-max (A): swap root element with
each operation]. last element and max heapify (root) →
[MCQ – 1 Mark] O(logn)
Insert (A, key): Insert and Heaping taken
A. O(logn), O(logn) → O(logn)
****
16
byjusexamprep.com
General 26.1 25 25 to 26
17
byjusexamprep.com
18
byjusexamprep.com
19
byjusexamprep.com
20