0% found this document useful (0 votes)
947 views28 pages

GATE 2024 Question Paper CS &IT With Solutions

Uploaded by

akanksha hatale
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
947 views28 pages

GATE 2024 Question Paper CS &IT With Solutions

Uploaded by

akanksha hatale
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

[MCQ]

Q.1. If '→' denotes increasing order of intensity, then the meaning of the words
[walk → jog → sprint] is analogous to [bothered → ___________ → daunted].
Which one of the given options is appropriate to fill the blank?
(a) phased
(b) phrased
COMPUTER SCIENCE & INFORMATION

(c) fazed
(d) fused
Sol. (c)
To make somebody worried or nervous.

[MSQ]
Q.2. Sequence the following sentences in a coherent passage.
P: This fortuitous geological event generated a colossal amount of energy and heat that
TECHNOLOGY

resulted in the rocks rising to an average height of 4 km across the contact zone.
Q: Thus, the geophysicists tend to think of the Himalayas as an active geological event
rather than as a static geological feature.
R: The natural process of the cooling of this massive edifice absorbed large quantities
of atmospheric carbon dioxide, altering the earth's atmosphere and making it better
snited for life.
S: Many millennia ago, a breakaway chunk of bedrock from the Antarctic Plate
collided with the massive Eurasian Plate.

(a) QSPR (b) SPRQ


(c) SRPQ (d) QPSR
Sol. (b)

[MCQ]
Q.3. Two wizards try to create a spell using all the four elements, water, air, fire, and earth.
For this, they decide to mix all these elements in all possible orders. They also decide
to work: independently. After trying all possible combination of elements, they
conclude that the spell does not work.
How many attempts does each wizard make before coming to this conclusion.
independently?
(a) 12 (b) 16
(c) 24 (d) 48
Sol. (c)

We use combination of 4 × 3 × 2 × 1 = 24
PAGE
1

PW Mobile APP: https://smart.link/7wwosivoicgd4 https://t.me/Gwcomsciandinfo

https://www.youtube.com/@GATEWallah_EE_EC_CS https://www.youtube.com/@GATEWallahbyPW
[MSQ]
Q.4. In an engineering college of 10,000 students. 1,500 like neither their core branches nor
other branches. The number of students who like their core branches is 1 / 4 th of the
number of students who like other branches. The number of students who like both
their core and other branches is 500 .
COMPUTER SCIENCE & INFORMATION

The number of students who like their core branches is


(a) 1.500 (b) 1.600
(c) 1.800 (d) 3.500
Sol. (c)

Number of students = 10000


Number of students not interested in both = 1500
 When diagram represent 10000 – 1500 = 8500
TECHNOLOGY

x = core, y = other branch (not core) = 4x


x + 4x = 8500 + 500
5x = 9000
x = 1800

[MSQ]
Q.5. In the 4 × 4 array shown below. each cell of the firs three tows has either a cross (X) or
a number.
The number in a cell represents the count of the inundate neighbouring cells (left, right,
top, bottom, diagonals) NOT planning a cross (X), Gives that the last row has no
crosses (X), the sum of the four numbers to be filled in the las row is
1 × 4 3
× 5 5 4
3 × 6 ×

(a) 12 (b) 9
(c) 11 (d) 10

Sol. (c)

PAGE
2

PW Mobile APP: https://smart.link/7wwosivoicgd4 https://t.me/Gwcomsciandinfo

https://www.youtube.com/@GATEWallah_EE_EC_CS https://www.youtube.com/@GATEWallahbyPW
1  4 3
 5 5 4
3  6 
2 4 3 2

Sum of fourth row = 2 + 4 + 3 + 2 = 11


COMPUTER SCIENCE & INFORMATION

[MSQ]
Q.6. A person sold two different items at the same price. He made 10 % profit in one item,
and 10 % loss in the other item. In selling these two items, the person made a total of
(a) 1 % loss
(b) 1 % profit
(c) 2 % loss
(d) 2 % profit
Sol. (a)
TECHNOLOGY

SP1 = SP2
10% profit × 10% loss
1.1 × 0.9 = 0.99
Less then 1 by 0.01
 1% loss.
OR
When the selling price of the both item is equal and the profit and loss is same we get
loss.
x2 10 2
Loss% = = = 1% .
100 100

[MCQ]
Q.7. A cube is to be cut into 8 pieces of equal size and shape. Here, each cut should be
straight and it should not stop till it reaches the other end of the cube.
The minimum number of such cuts required is.
(a) 3 (b) 7
(c) 8 (d) 4

Sol. (c)

As x cut on each edge gives number of small cubes = (x + 1)3 = 8 (given)

 x = 1 cut on each edge


Thus, three cuts take place.

PAGE
[MCQ]
3

PW Mobile APP: https://smart.link/7wwosivoicgd4 https://t.me/Gwcomsciandinfo

https://www.youtube.com/@GATEWallah_EE_EC_CS https://www.youtube.com/@GATEWallahbyPW
Q.8. In the sequence 6,9,14, x, 30,41, a possible value of x is
(a) 18 (b) 25
(c) 21 (d) 20
Sol. (c)
COMPUTER SCIENCE & INFORMATION

x = 14 + 7 = 21

[MCQ]
Q.9. For positive non-zero real variables x and y, if
𝑥+𝑦 1
𝑙𝑛 ( ) = [𝑙𝑛( 𝑥) + 𝑙𝑛( 𝑦)]
2 2
𝑥 𝑦
then, the value of 𝑦 + 𝑥 is.
TECHNOLOGY

(a) 1 (b) 4
(c) 2 (d) ½

Sol. (c)

x+ y 1
ln   = [ln x + lny ]
 2  2

x+ y 1
ln   =  lnxy 
 2  2

x+ y
ln   = ln xy
 2 

x+ y
= xy
2

x 2 + y 2 + 2 xy = 4 xy

x y
+ +2=4
y x

x y
+ =2
y x

[MCQ]
Q.10. The pie charts depict the shares of various power generation technologies in the total
electricity generation of a country for the years 2007 and 2023 .

PAGE
4

PW Mobile APP: https://smart.link/7wwosivoicgd4 https://t.me/Gwcomsciandinfo

https://www.youtube.com/@GATEWallah_EE_EC_CS https://www.youtube.com/@GATEWallahbyPW
The renewable sources of electricity generation consist of Hydro, Solar and Wind.
COMPUTER SCIENCE & INFORMATION

Assuming that the total electricity generated remains the same from 2007 to 2023,
what is the percentage increase in the share of the renewable sources of electricity
generation over this period?

(a) 25% (b) 50%


(c) 62.5% (d) 77.5%

Sol. (c)

For 2007
TECHNOLOGY

Renewable energy generate electricity

Hydro + Solar + Wind = 30% + 5% + 5% = 40%

For 2023

= 35% + 20% + 10% = 65%

 65 − 40 
% increase in share =   % = 62.5%
 40 

[MCQ]
Q.1. Consider the following C program. Assume parameters to a function are evaluated from
right to left.
#include <stdio. h>
int g(int p) {printf("%d", p); return pr}
int h(int q) {print f("%d", q); return q;}
void f (int x, int y)
{
g(x) :
h(y),
}
int main()
{
f(g(10), h(20));
}
Which one of the following options is the CORRECT output of the above C program?
PAGE
(a) 20102010 (b) 10201020 5

PW Mobile APP: https://smart.link/7wwosivoicgd4 https://t.me/Gwcomsciandinfo

https://www.youtube.com/@GATEWallah_EE_EC_CS https://www.youtube.com/@GATEWallahbyPW
(c) 20101020 (d) 10202010
Sol. ()

It is said that parameters are evaluated from left to right


So, f(g(10), h(20)) will print 20 10
and then, g(x) and h(y) will print 10 20 respectively)
COMPUTER SCIENCE & INFORMATION

 20 10 10 20
Therefore, 20101020 will be printed option C is the correct answer.
TECHNOLOGY

[MCQ]
Q. 2. Once the DBMS informs the user that a transaction has been successfully completed,
its effect should persist even if the system crashes before all its changes are reflected
on disk. This property is called
(a) Consistency (b) isolation
(c) durability (d) atomicity

Sol. ()

[MCQ]
Q. 3. Let f(x) be a continuous function from ℝ to ℝ such that f(x)=1 – f(2-x)
2
Which one of the following options is the CORRECT value of ∫0 𝑓(𝑥) 𝑑𝑥 ?
(a) –1 (b) 1
(c) 0 (d) 2
Sol. ()

[MCQ]
Q. 4. Let A be the adjacency matrix of a simple undirected graph G. Suppose A is its own PAGE
inverse. Which one of the following statements is always TRUE? 6

PW Mobile APP: https://smart.link/7wwosivoicgd4 https://t.me/Gwcomsciandinfo

https://www.youtube.com/@GATEWallah_EE_EC_CS https://www.youtube.com/@GATEWallahbyPW
(a) G is a complete graph (b) There is no such graph G
(c) G is a cycle (d) G is a perfect matching

Sol. ()
COMPUTER SCIENCE & INFORMATION

[MCQ]
Q.5. Consider the following two sets:
Set X Set Y
P. Lexical Analyzer 1. Abstract Syntax Tree
Q. Syntax Analyzer 2. Token
R. Intermediate Code Generator 3. Parse Tree
S. Code Optimizer 4. Constant Folding
Which one of the following options is the CORRECT match from Set X to Set Y ?
(a) P-4: Q-1: R-3 ; S-2 (b) P-2: Q-1: R-3 ; S-4
(c) P-2: Q-3: R-1 ; S-4 (d) P-4: Q-3: R-2 ; S-1
TECHNOLOGY

Sol. ()

[MCQ]
Q. 6. Consider the following C function definition.
int fX (char *a)
{
char *b = a;
while (*b)
b++;
return b – a;
}
Which of the following statements is/are TRUE?
(a) The function call fX ("abcd") will always return a value
(b) Assuming a character array c is is declared as char c[] = “abcd” in main () the
function call fX (c) will always return a value
(c) The code of the function will not compile
(d) Assuming a character pointer c is is declared as char *c = “abcd” in main () the
function call fX (c) will always return a value
Sol. (a, b, d)
The function fX() returning length of string by calculating the difference between
address of first and last character(pointer arithmetic is used).
Option A is TRUE , fX(“ABCD”) will return 4
Option B is also TRUE, FX(c) will return 4
Option C is false , no compilation error
Option D is TRUE, character pointer will also return a value. PAGE
7

PW Mobile APP: https://smart.link/7wwosivoicgd4 https://t.me/Gwcomsciandinfo

https://www.youtube.com/@GATEWallah_EE_EC_CS https://www.youtube.com/@GATEWallahbyPW
[MCQ]
Q. 7. Which one of the following regular expressions is equivalent to the language
accepted by the DFA given below?
(a) 0*1 (0 + 10*1) (b) 0* (10*11) *0*
(c) 0 (1 + 0*10*1) *0* (d) 0*1(010*1) *0*
COMPUTER SCIENCE & INFORMATION

Sol. ()
TECHNOLOGY

[MCQ]
Q. 8. When six unbiased dice are rolled simultaneously the probability of getting all distinct
number (i.e., 1, 2,3,4,5 and 6) is
(a) 7/324 (b) 1/324
(c) 5/324 (d) 11/324
Sol. (c)

Total case for the throw of six device = 66 = 66.


Now, the number of forwardable outcomes
= 6!
6! 5  4  3  2
Thus P ( E ) = 6 =
6 65
5 4 5 4
= =
6 4 66
10 5
= =
3 3 2 6 2
324

[MSQ]
Q. 9. Which of the following statements is/are FALSE?
(a) An attribute grammar is a syntax-directed definition (SDD) in which the
functions in the semantic rules have no side effects
(b) All L-attributed definitions based on LR(1) grammar can be evaluated using a
bottom-up parsing strategy
(c) The attributes in a L-attributed definition cannot always be evaluated in a depth PAGE
first order 8

PW Mobile APP: https://smart.link/7wwosivoicgd4 https://t.me/Gwcomsciandinfo

https://www.youtube.com/@GATEWallah_EE_EC_CS https://www.youtube.com/@GATEWallahbyPW
(d) Synthesized attributes can be evaluated by a bottom-up parser as the input is
parsed
Sol. ()
COMPUTER SCIENCE & INFORMATION

[NAT]
Q.10. Let A be an array containing integer values. The distance of A is defined as the
minimum number of elements in A that must be replaced with another integer so that
the resulting array is sorted in non-decreasing order. The distance of the array
[2,5,3,1,4,2,6] is

Sol. (3 to 3)

First, let's sort the array in non-decreasing order:


Sorted A: [1, 2, 2, 3, 4, 5, 6]
Now, let's compare this sorted array with the original array A to find the differences:
TECHNOLOGY

Original A: [2, 5, 3, 1, 4, 2, 6]
Sorted A: [1, 2, 2, 3, 4, 5, 6]
The differences are:
1. A[0] needs to be replaced with 1.
2. A[2] needs to be replaced with 2.
3. A[5] needs to be replaced with 5.
So, the minimum number of replacements needed is 3. Thus, the distance of A is 3.

[MCQ]
Q.11. Which of the following file organizations is/are IO efficient for the scan operation in
DBMS?

(a) Unclustered hash index


(b) Heap
(c) Sorted
(d) Unclustered tree index

Sol. ()

[NAT]
Q.12. Let P be the partial order defined on the set {1,2,3,4} as follows
PAGE
P = {(x, x) \ x (1, 2, 3, 4)} [(1,2), (3,2), (3,4)] 9

PW Mobile APP: https://smart.link/7wwosivoicgd4 https://t.me/Gwcomsciandinfo

https://www.youtube.com/@GATEWallah_EE_EC_CS https://www.youtube.com/@GATEWallahbyPW
The number of total orders on {1,2,3,4} that contain P is _________

Sol. ()

[NAT]
COMPUTER SCIENCE & INFORMATION

Q.13. The format of a single-precision floating-point number as per the IEEE 754 standard
is-
Sign(1bit) Exponent (8 bits) Mantissa(23 bits)

Coose the largest floating-point number among the following option.

(a) sign Exponent Mantissa

0 01111111 0000 0000 0000 0000 0000 0000


TECHNOLOGY

(b) sign Exponent Mantissa

0 0111 1111 1111 1111 1111 1111 1111 1111

(c) sign Exponent Mantissa

0 1111 1110 1111 1111 1111 1111 1111 1111

(d) sign Exponent Mantissa

0 1111 1110 1111 1111 1111 1111 1111 1111

Sol. (c)

Sign Exponent Mantissa


0 11111110 23 1’s
Will give the maximum value in single precision (IEEE 754 format)

[MCQ]
Q.14. Which of the following statements about IPv 4 fragmentation is/are TRUE?
(a) The fragmentation of an IP datagram is performed only at the source of the
datagram
(b) The fragmentation of an IP datagram is performed at any IP router which finds
that the size of the datagram to be transmitted exceeds the MTU
PAGE
(c) The reassembly of fragments is performed at all intermediate routers along the 10
path from the source to the destination

PW Mobile APP: https://smart.link/7wwosivoicgd4 https://t.me/Gwcomsciandinfo

https://www.youtube.com/@GATEWallah_EE_EC_CS https://www.youtube.com/@GATEWallahbyPW
(d) The reassembly of fragments is performed only at the destination of the datagram
Sol. (b, d)

• Fragmentation of IP datagram is performed at any intermediate IP router when size


of datagram is greater the MTU of the network.
• Reassembly of fragments is performed only at the destination.
COMPUTER SCIENCE & INFORMATION

[MCQ]
Q.15. For a Boolean variable x, which of the following statements is/are FALSE?
(a) x.x = 0 (b) x.1 = x
(c) x+1=x (d) x+𝑥̄=1
Sol. ()
TECHNOLOGY

[MCQ]
Q.16. Which of the following tasks is/are the responsibility/responsibilities of the memory
management unit (MMU) in a system with paging-based memory management?
(a) Allocate a new page table for a newly created process
(b) Raise a trap when a virtual address is not found in the page table
(c) Raise a trap when a process tries to write to a page marked with read-only
permission in the page table
(d) Translate a virtual address to a physical address using the page table
Sol. ()

[MCQ]
Q.17. Let T(n) be the recurrence relation defined as follows:

T(0) = 1,
T(1) = 2, and
T(n) = 5T(n – 1) – 6T(n – 2) for n  2
Which one of the following statements is TRUE?
(a) T(n) = (3n) (b) T(n) = (3n)
(c) T(n) = (2n) (d) T(n) = (n3n)
Sol. (b)

5an –1 − 6 an –1
PAGE
11

PW Mobile APP: https://smart.link/7wwosivoicgd4 https://t.me/Gwcomsciandinfo

https://www.youtube.com/@GATEWallah_EE_EC_CS https://www.youtube.com/@GATEWallahbyPW
an + 2 − 5an +1 – 6 an
Characteristic equation = t2 – 5t + 6 = 0
Characteristic root = t = 3, 2
Complimentary function = C1(t1)n + C2(t2)n + (n) = C1(3)n + C2(6)n = 0(3n)

[MCQ]
COMPUTER SCIENCE & INFORMATION

Q.18. Consider a computer with a 4MHz processor. Its DMA controller can transfer 8 bytes
in 1 cycle from a device to main memory through cycle stealing at regular intervals.
Which one of the following is the data transfer rate (in bits per second) of the DMA
controller if 1% of the processor cycles are used for DMA?

(a) 25,60,000 (b) 2,56,000


(c) 32,00 (d) 32,000
Sol. (d)

1
8 bytes transfer time = 1 cycle = = 0.25  sec.
TECHNOLOGY

4MHz

transfer time to memory


% of time CPU block =
Pr eparation time
0.25 sec.
0.01 =
Prepration time

Preparation time = 25 sec.


In 25 sec. data prepared = 8 byte
8B
In 1 sec. data prepared = = 0.32 B /  sec.
25 sec.

0.32 B
In 1 sec. data prepared = = 320000 B / sec.
10 –6 sec.

[MCQ]
Q.19. In the context owner and weak entity sets in the ER (Entity-Relationship) data model
which one of the following statement is TRUE?

(a) Neither weak entity set nor owner entity set MUST have total participation in
the identifying relationship
(b) Both weak and owner entity sets MUST have total participation in the
identifying relationship
(c) The owner entity set MUST have total participation in the identifying
relationship
(d) The weak entity set MUST have total participation in the identifying relationship
Sol. (d)
In a ER diagram, the weak entity must participate totally and the strong entity set may PAGE
have partial or total participation. 12

PW Mobile APP: https://smart.link/7wwosivoicgd4 https://t.me/Gwcomsciandinfo

https://www.youtube.com/@GATEWallah_EE_EC_CS https://www.youtube.com/@GATEWallahbyPW
[MCQ]
Q.20. Node X has a TCP connection open to node Y. The packets from X to Y go through
and intermediate IP router R. Ethernet switch S is the first switch on the network path
between X and R consider a packet sent from X to Y over this connection.
COMPUTER SCIENCE & INFORMATION

Which of the following statements is / are TRUE about the destination IP and MAC
addresses on this packet at the time it leaves X?
(a) The destination MAC address is the MAC address of Y
(b) The destination IP address is the IP address of R
(c) The destination IP address is the IP address of Y
(d) The destination MAC address is the MAC address of S
Sol. (c, d)
TECHNOLOGY

X send packets to y

 In IP datagram at x, destination IP address is always IP address of y.

 In frame at x, destination MAC address is MAC address of next node that is S.


(Node to node Communication)

[MCQ]
Q.21. Let p and q be the following propositions:
p: Fail grade can be given.
q: Student scores more than 50% marks
Consider the statement “Fail grade cannot be given when student scores more than 50%
marks”
Which one of the following is the CORRECT representation of the above statement in
propositional logic?
(a) q→p (b) q→p
(c)  p→q (d) p→q
Sol. ()

[MCQ]
Q.22. Consider a process P running on CPU which one or more of the following events will
always trigger a context switch by the OS that results in process P moving to a non-
running state (e.g., ready blocked)?
PAGE
(a) An interrupt is raised by the disk to deliver data requested by some other
13
process

PW Mobile APP: https://smart.link/7wwosivoicgd4 https://t.me/Gwcomsciandinfo

https://www.youtube.com/@GATEWallah_EE_EC_CS https://www.youtube.com/@GATEWallahbyPW
(b) A timer interrupt is raised by the hardware
(c) P tries to access a page that is the swap space triggering a page fault
(d) P make a blocking system call to read a block of data from the disk
Sol. ()
COMPUTER SCIENCE & INFORMATION

[MCQ]
Q.23. Which of the following about the two phase locking (2PL) protocol is/are TRUE
(a) A deadlock is possible with 2PL
(b) 2PL permit only serializable schedules
(c) With 2PL, a transaction always a locks the data item being read or written just
before every operation and always releases the lock just after the operation
(d) With 2PL, once a lock is released on any data item inside a transaction no more
locks on any data item can be obtained inside that transaction
Sol. ()
TECHNOLOGY

[MCQ]
Q.24. An instruction format has the following structure
Instruction number opcode destination reg source reg-I, source red-2
Consider the following sequence of instruction to be executed in a pipelined processor
I1: DIV R3, R1, R2
I2: SUB R5, R3, R4
I3: ADD R3, R5, R6
I4: MUL R7, R3, R8
Which of the following statement is/are TRUE?
(a) There is a WAW dependency on R3 between I3 and I4
(b) There is a WAW dependency on R3 between I1 and I3
(c) There is a RAW dependency on R3 between I1 and I2
(d) There is a RAW dependency on R3 between I2 and I3
Sol. (c, d)
I1 : R3  R1/ R2
I2 : R5  R3 – R4
I3 : R3  R5 + R6
I4 : R7  R3 + R8
RAW dependencies: I1 to I2 for R3
I2 to I3 for R5
I3 to I4 for R3
PAGE
WAR dependencies: I2 to I3 for R3 14

PW Mobile APP: https://smart.link/7wwosivoicgd4 https://t.me/Gwcomsciandinfo

https://www.youtube.com/@GATEWallah_EE_EC_CS https://www.youtube.com/@GATEWallahbyPW
WAR dependencies: I1 to I3 for R3
[MCQ]
Q.25. Which of the following fields of an IP header is/are always modified by any router
before it forwards the IP packed?
(a) Source IP address (b) Header Checksum
(c) Time to Live (TTL) (d) Protocol
COMPUTER SCIENCE & INFORMATION

Sol. (b, c)

Time to live (TTL) field is always decremented by one at every intermediate router
before forwarding it, to prevent looping of packets in the network.

• Any modification in IP(v4) header leads to new header checksum calculation.


• Protocol decided by source host only and can not be change by intermediate routers.
• Source IP address is not to be change at any intermediate router, it is determine by
source network only.
TECHNOLOGY

[NAT]
Q.26. Consider an Ethernet segment with a transmission speed of 108 bits/sec and a maximum
segment length of 500 meters. If the speed of propagation of the signal in the medium
is 2×108 meters/sec, then the minimum frame size (in bits) required for collision
detection is ______________.
Sol. (500 bits)
Data transfer rate = 108 bit/sec.
Distance = 500 meter
Signal speed = 2 × 108 meter /sec.
Frame size = n bits
Frame length
Transmission time (tx) =
D .T .R .

n bits n
tx = = sec.
8
10 bits / sec. 108

500 meter 500


tp = = sec.
2  10 meter / sec.
8
2  108
For collision detection in ethernet t x  2 t p

n 500
sec.  2  sec.
10 8
2  108
n  500

[NAT]
Q.27. A non-pipelined instruction execution unit operating at 2 GHz takes an average of 6
cycles to execute an instruction of a program P. The unit is then redesigned to operate PAGE
on a 5-stage pipeline at 2 GHz. Assume that the ideal throughput of the pipelined unit 15

PW Mobile APP: https://smart.link/7wwosivoicgd4 https://t.me/Gwcomsciandinfo

https://www.youtube.com/@GATEWallah_EE_EC_CS https://www.youtube.com/@GATEWallahbyPW
is 1 instruction per cycle. In the execution of program P. 20% instructions incur an
average of 2 cycles stall due to data hazards and 20% instructions incur an average of
3 cycles stall due to control hazards. The speedup (rounded off to one decimal place)
obtained by the pipelined design over the non-pipelined design is _____________.
Sol. (3)
Pipeline
COMPUTER SCIENCE & INFORMATION

Non-pipeline:-
1
tn =  6 = 3n sec.
2Gz
Sagemont (k) = 5
CPI of pipeline = 1 + 0.2 × 2 + 0.2 ×3
=2
3
Speed up = =3
2  0.5
[NAT]
Q.28. Let L₁ be the language represented by the regular expression b* ab* (ab* ab*)* and L₂
TECHNOLOGY

= {w ∈ (a + b)* | |w | ≤ 4}, where |w| denotes the length of string W. The number of
strings in L₂ which are also in L₁ is __________.
Sol. (*)

[MCQ]
Q.29. Let A be an n × n matrix over the set of all real numbers ℝ. Let B be a matrix obtained
from A by swapping two rows. Which of the following statements is/are TRUE?
(a) If A is invertible, then B is also invertible
(b) The determinant of B is the negative of the determinant of A
(c) If A is symmetric, then B is also symmetric
(d) If the trace of A is zero, then the trace of B is also zero
Sol. (*)

[MCQ]
Q.30. Consider a single processor system with four processes A, B, C. and D. represented as
given below, where for each process the first value is its arrival time, and the second
value is its CPU burst time.
A (0, 10), B (2, 6), C (4, 3), and D (6. 7).
Which one of the following options gives the average waiting times when preemptive
Shortest Remaining Time First (SRTF) and Non-Preemptive Shortest Job First (NP-
SJF) CPU scheduling algorithms are applied to the processes?
(a) SRTF = 6. NP - SJF = 7.5 (b) SRTF = 7. NP - SJF = 7.5
(c) SRTF = 7. NP - SJF = 8.5 (d) SRTF = 6. NP - SJF = 7
Sol. (*)

[NAT] PAGE
16

PW Mobile APP: https://smart.link/7wwosivoicgd4 https://t.me/Gwcomsciandinfo

https://www.youtube.com/@GATEWallah_EE_EC_CS https://www.youtube.com/@GATEWallahbyPW
Q.31. Consider a disk with the following specifications: rotation speed of 6000 RPM, average
seek time of 5 milliseconds, 500 sectors/track, 512-byte sectors. A file has content
stored in 3000 sectors located randomly on the disk. Assuming average rotational
latency, the total time (in seconds, rounded off to 2 decimal places) to read the entire
file from the disk is __________.
Sol. (*)
COMPUTER SCIENCE & INFORMATION

[MCQ]
Q.32. Let M be the 5-state NFA with ∈ - transitions shown in the diagram below.
Which one of the following regular expressions represents the language accepted by
M?
TECHNOLOGY

(a) 0* + (1 + 0 (00)*) (11)* (b) 0+ + 1 (11)* + 0 (11)*


(c) (00)* + (1 + (00)*) (11)* (d) (00)* + 1(11)*
Sol. (*)

[MCQ]
Q.33. Which of the following is/are EQUAL to 224 in radix-5 (i.e., base-5) notation?
(a) 64 in radix-10 (b) 100 in radix-8
(c) 121 in radix-7 (d) 50 in radix-16
Sol. (*)

[MCQ]
Q.34. Let S1 and S2 be two stacks. S1 has capacity of 4 elements. S2 has capacity of 2
elements. S1 already has 4 elements: 100, 200, 300. and 400. whereas S2 is empty, as
shown below.

400 (Top)
300
200
100
Stack S1 Stack S2

Only the following three operations are available:


PushToS2: Pop the top element from S1 and push it on S2.
PAGE
PushToS1: Pop the top element from S2 and push it on S1.
17
Generate Output: Pop the top element from S1 and output it to the user.

PW Mobile APP: https://smart.link/7wwosivoicgd4 https://t.me/Gwcomsciandinfo

https://www.youtube.com/@GATEWallah_EE_EC_CS https://www.youtube.com/@GATEWallahbyPW
Note that the pop operation is not allowed on an empty stack and the push operation is
not allowed on a full stack.
Which of the following output sequences can be generated by using the above
operations?
(a) 200, 300, 400, 100 (b) 400, 200, 100, 300
(c) 100, 200, 400, 300 (d) 300, 200, 400, 100
COMPUTER SCIENCE & INFORMATION

Sol. (a, b, d)
TECHNOLOGY

With the following operation sequence 200, 300, 400, 100 can be generated.
Push to S2
Pust to s2
Generate output. // 200
Push to S1
Generated output // 300
Push to S1
Generate output // 400
Push to S1
Generate output // 100
With the following operation sequence 400, 200, 100, 300 can be generated.
Generate output // 400
Push to S2
Generate output // 200
Generate output // 100
Push to S1
Generated output // 300
With the following operation sequence 300, 200, 400, 100 can be generated.
Push to S2
Generate output // 300 PAGE
Generate output // 200 18

PW Mobile APP: https://smart.link/7wwosivoicgd4 https://t.me/Gwcomsciandinfo

https://www.youtube.com/@GATEWallah_EE_EC_CS https://www.youtube.com/@GATEWallahbyPW
Push to S1
Generate output // 400
Generate output // 100.
So, option A, B, and D can be generated.
COMPUTER SCIENCE & INFORMATION

[MCQ]
Q.35. Which one of the following CIDR prefixes exactly represents the range of IP addresses
10.12.2.0 to 10.12.3.255?
(a) 10.12.2.0/24 (b) 10.12.2.0/22
(c) 10.12.0.0/22 (d) 10.12.2.0/23
Sol. (d)
10.12.2.0 to 10.12.3.255
10.12.0000001 0.00000000
TECHNOLOGY

10.12.0000001 1.11111111
23-bit common prefix and last 9 bits are all zero’s to all one’s
10.12.2.0/23

[MCQ]
Q.36. Consider 4-variable functions f1, f2, f3, f4 expressed in sum-of-minterms form as given
below.
f1 = ∑ (0, 2, 3, 5, 7, 8, 11, 13)
f2 = ∑ (1, 3, 5, 7, 11, 13, 15)
f3 = ∑ (0, 1, 4, 11)
f4 = ∑ (0, 2, 6, 13)

With respect to the circuit given above, which of the following options is/are
CORRECT?
(a) Y = Π (8, 9, 10, 11, 12, 13, 14, 15)
(b) Y = ∑ (0, 1, 2, 11, 13)
(c) Y = ∑ (0, 1, 2, 3, 4, 5, 6, 7)
(d) Y = Π (3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15)
Sol. (a,c)

Y =  (0,1,2,3,4,5,6,7)
PAGE
Y =  (8,9,10,11,12,13,14,15)
19

PW Mobile APP: https://smart.link/7wwosivoicgd4 https://t.me/Gwcomsciandinfo

https://www.youtube.com/@GATEWallah_EE_EC_CS https://www.youtube.com/@GATEWallahbyPW
[MCQ]
Q.37. Let G be an undirected connected graph in which every edge has a positive integer
weight. Suppose that every spanning tree in G has even weight. Which of the following
statements is/are TRUE for every such graph G?
(a) In each cycle C in G, all edges in C have even weight
(b) All edges in G have even weight
COMPUTER SCIENCE & INFORMATION

(c) In each cycle C in G, either all edges in C have even weight OR all edges in C
have odd weight
(d) All edges in G have even weight OR all edges in G have odd weight
Sol. (a, b, c)

(a) In each cycle C in G, all edges in C have even weight:


True. Removing any odd-weighted edge from a cycle would result in a spanning
tree with an odd weight, contradicting the property that every spanning tree in G
has even weight. Therefore, all edges in every cycle must have even weight.
(b) All edges in G have even weight:
True. Since every spanning tree in G has even weight, adding any edge to any
TECHNOLOGY

spanning tree must result in a tree with an odd weight. Therefore, all edges in G
must have even weight.
(c) In each cycle C in G, either all edges in C have even weight OR all edges in C
have odd weight:
True. If every spanning tree in G has even weight, then in any cycle in G, either
all edges have even weight (to maintain the even weight property of spanning
trees) or all edges have odd weight.
(d) All edges in G have even weight OR all edges in G have odd weight:
False. While every spanning tree has even weight, this doesn't imply that all
edges in G must have even weight or all edges in G must have odd weight. It's
possible for both even and odd-weighted edges to coexist in G, as long as every
spanning tree maintains the even weight property.
Therefore, options (a), (b), and (c) are true for every such graph G, but option (d) is
false.

[MCQ]
Q.38. What is the output of the following C program?
#include <stdio.h>
int main() {
double a [2] = {20.0, 25.0), *p, *q;
p = a;
q = p + 1;
printf("%d, %d", (int) (q - p), (int) (*g - *p)); return 0;}
(a) 8, 5 (b) 1, 8
(c) 1, 5 (d) 4, 8
Sol. (c)

1. double a[2] = {20.0, 25.0};


PAGE
Initializes an array a with two double values, 20.0 and 25.0. 20

PW Mobile APP: https://smart.link/7wwosivoicgd4 https://t.me/Gwcomsciandinfo

https://www.youtube.com/@GATEWallah_EE_EC_CS https://www.youtube.com/@GATEWallahbyPW
2. double *p, *q;
Declares two pointers p and q to double.
3. p = a;
Assigns the address of the first element of array a to pointer p.
4. q = p + 1;
Assigns the address of the second element of array a to pointer q.
COMPUTER SCIENCE & INFORMATION

5. printf("(%d, %d)", (int)(q - p), (int)(*q - *p));


Prints the difference of the addresses (casting to int) and the difference of the values
pointed to by q and p (casting to int).
The expression (q - p) calculates the difference in addresses, which is 1 (since q is one
position ahead of p).
The expression (*q - *p) calculates the difference in values pointed to by q and p, which
is 5 (25.0 - 20.0).
So, the correct output will be (1, 5). Therefore, the correct option is (c) 1, 5.
TECHNOLOGY

[MCQ]
Q.39. Consider the following expression: x[i] = (p + r) * -s[i] + u/w. The following sequence
shows the list of triples representing the given expression, with entries missing for
triples (1), (3), and (6).

(0) + P r
(1)
(2) uminus (1)
(3)
(4) / U W
(5) + (3) (4)
(6)
(7) = (6) (5)

Which one of the following options fills in the missing entries CORRECTLY?
(a) (1) []= si (3) - (0) (2) (6)=[] x (5)
(b) (1)=[] si (3) * (0) (2) (6) []= x (5)
(c) (1) = [] si (3)* (0) (2) (6) []= xi
(d) (1) []= si (3) - (0) (2) (6) = [] xi
Sol. (*)

[NAT]
Q.40. A processor with 16 general purpose registers uses a 32-bit instruction format. The
instruction format consists of an opcode field, an addressing mode field, two register
operand fields, and a 16-bit scalar field. If 8 addressing modes are to be supported. the
maximum number of unique opcodes possible for every addressing mode is _______. PAGE
21
Sol. (40)

PW Mobile APP: https://smart.link/7wwosivoicgd4 https://t.me/Gwcomsciandinfo

https://www.youtube.com/@GATEWallah_EE_EC_CS https://www.youtube.com/@GATEWallahbyPW
Ins(n) size = 32 bit

16 Register  Reg. A.F = 4 bit

8 addressing mode  mode field = 36 bit

Scaler field (immediate field) = 16 bit


COMPUTER SCIENCE & INFORMATION

Opcode = 32 – (3 + 4 + 4 + 16)

= 32 – 27

= 5 bits

Number of opcode = 25 = 32
TECHNOLOGY

[NAT]
Q.41. The number of distinct minimum-weight spanning trees of the following graph is
_________.

Sol. (9 to 9)

from vertex there are 3 possibilities for every edge from a, b, f = 3 + 3 + 3 = 9


[MCQ]
Q.42. Consider an array X that contains n positive integers. A subarray of X is defined to be
a sequence of array locations with consecutive indices. PAGE
22

PW Mobile APP: https://smart.link/7wwosivoicgd4 https://t.me/Gwcomsciandinfo

https://www.youtube.com/@GATEWallah_EE_EC_CS https://www.youtube.com/@GATEWallahbyPW
The C code snippet given below has been written to compute the length of the longest
subarray of X that contains at most two distinct integers. The code has two missing
expressions labelled (P) and (Q).

int first=0, second=0, lenl=0, len2=0, maxlen=0;


for (int i=0; i < n; i++) {
if (X[i] == first) {
COMPUTER SCIENCE & INFORMATION

len2++; lenl++;
} else if (X[i] == second) {
len2++;
lenl = (P) ;
second = first;
} else {
len2 = (Q) ;
lenl = 1; second = first;
)
if (len2 > maxlen) {
maxlen = lenl;
TECHNOLOGY

}
first = X[i];
}
Which one of the following options gives the CORRECT missing expressions?
(Hint: At the end of the i-th iteration, the value of len l is the length of the longest
subarray ending with X[i] that contains all equal values, and len2 is the length of the
longest subarray ending with X[i] that contains at most two distinct values.)
(a) (P) 1 (Q) len 1 + 1
(b) (P) len 2 + 1 (Q) len 1 + 1
(c) (P) 1 (Q) len 2 + 1
(d) (P) len 1 + 1 (Q) len 2 + 1
Sol. (c)

The value of len1 is the length of the longest subarray ending with X [ i ] that contains
all equal values, at the ith iteration. Hence length 1 will assign every time its equal to
second value.
Hence len1 = 1
and len2 is the length of the longest subarray ending with X [ i ] that contains at most
two distinct values. Hence if its equal to previous value then its updated to len2+1

[NAT]
Q.43. Consider a TCP connection operating at a point of time with the congestion window of
size 12 MSS (Maximum Segment Size), when a timeout occurs due to packet loss.
Assuming that all the segments transmitted in the next two RTTs (Round Trip Time)
are acknowledged correctly, the congestion window size (in MSS) during the third RTT
will be ____________.
PAGE
23

PW Mobile APP: https://smart.link/7wwosivoicgd4 https://t.me/Gwcomsciandinfo

https://www.youtube.com/@GATEWallah_EE_EC_CS https://www.youtube.com/@GATEWallahbyPW
Sol. (4 to 4)
• CWND = 12 MSS
Threshold occur
CWND
Threshold = = 6 MSS
2
CWND = 1 MSS
COMPUTER SCIENCE & INFORMATION

TCP congestion control enters into slow start phase


(CWND< Thresholds), CWND increase by one after
each segment acknowledged. In slow start phase
CWND almost get double at the end of every RTT.
[NAT]
Q.44. Consider a 32-bit system with 4 KB page size and page table entries of size 4 bytes
each. Assume 1 KB = 210 bytes. The OS uses a 2-level page table for memory
management, with the page table containing an outer page directory and an inner page
table. The OS allocates a page for the outer page directory upon process creation. The
OS uses demand paging when allocating memory for the inner page table, i.e., a page
TECHNOLOGY

of the inner page table is allocated only if it contains at least one valid page table entry.
An active process in this system accesses 2000 unique pages during its execution, and
none of the pages are swapped out to disk. After it completes the page accesses. let X
denote the minimum and Y denote the maximum number of pages across the two levels
of the page table of the process.
The value of X+Y is_________.
Sol. (*)

[MCQ]
Q.45. Consider the following context-free grammar where the start symbol is S and the set of
terminals is {a.b.c.d}.
S → AaAb | BbBa
A → cS | ∈
B → dS | ∈
The following is a partially-filled LL(1) parsing table.

a b c d $
S S→AaAb S→BbBa (1) (2)
A A→∈ (3) A→cS
B (4) B→∈ B→dS

Which one of the following options represents the CORRECT combination for the
numbered cells in the parsing table?
Note: In the options, "blank" denotes that the corresponding cell is empty. ∈→
(a) (1) S→BbBa (2) S→AaAb (3) blank (4) blank
(b) (1) S→AaAb (2) S→BbBa (3) blank (4) blank
(c) (1) S→BbBa (2) S→ AaAb (3) A → ∈ (4) B→∈ PAGE
24
(d) (1) S→AaAb (2) S→BbBa (3) A→∈ (4) B→∈

PW Mobile APP: https://smart.link/7wwosivoicgd4 https://t.me/Gwcomsciandinfo

https://www.youtube.com/@GATEWallah_EE_EC_CS https://www.youtube.com/@GATEWallahbyPW
Sol. (*)

[NAT]
Q.46. A processor uses a 32-bit instruction format and supports byte-addressable memory
access. The ISA of the processor has 150 distinct instructions. The instructions are
equally divided into two types, namely R-type and I-type, whose formats are shown
below.
COMPUTER SCIENCE & INFORMATION

R-type Instruction Format:


OPCODE UNUSED DST Register SRC Register 1 SRC Register 2
I-type Instruction Format:
OPCODE DST SRC Register # Immediate value/address
Register

In the OPCODE. 1 bit is used to distinguish between I-type and R-type instructions and
the remaining bits indicate the operation. The processor has 50 architectural registers,
and all register fields in the instructions are of equal size.
TECHNOLOGY

Let X be the number of bits used to encode the UNUSED field. Y be the number of bits
used to encode the OPCODE field, and Z be the number of bits used to encode the
immediate value/address field. The value of X + 2Y + Z is ___________.
Sol. (34)

Number of instructions = 150

150
I – type instructions = = 75  opcode  1 + 7 = 8 bits
2

150
R – type instructions = = = 75  opcode  1 + 7 = bits
2

R– type instructions = 50  Number of bits for register reference = 6 bits

I– type instructions

Unused = 6

I– type instructions

Immediate value = 12 bits

X=6

Y= 8 PAGE
25
Z = 12

PW Mobile APP: https://smart.link/7wwosivoicgd4 https://t.me/Gwcomsciandinfo

https://www.youtube.com/@GATEWallah_EE_EC_CS https://www.youtube.com/@GATEWallahbyPW
X + 2y + z = 6 + (2 * 8) + 12 = 36 bits

[NAT]
Q.47. Let Zn be the group of integers {0, 1, 2,..., n - 1} with addition modulo n as the group
operation. The number of elements in the group Z2 × Z3 × Z4 that are their own
inverses is _________.
Sol. (*)
COMPUTER SCIENCE & INFORMATION

[NAT]
Q.48. The chromatic number of a graph is the minimum number of colours used in a proper
colouring of the graph. The chromatic number of the following graph is ___________.
TECHNOLOGY

Sol. (2 to 2)

The chromatic number of given graph is 2.


[MCQ]
Q.49. Consider a multi-threaded program with two threads T1 and T2. The threads share two
semaphores: s1 (initialized to 1) and s2 (initialized to 0). The threads also share a global
variable x (initialized to 0). The threads execute the code shown below.

// code of Tl // code of T2
wait (s1); wait (s1);
x = x+1; x = x+1;
print(x); print(x) ;
wait(s2); signal (s2);
signal(s1); signal(s1);

Which of the following outcomes is/are possible when eads T1 and T2 execute
concurrently?
(a) T2 runs first and prints 1. T1 does not print anything (deadlock)
(b) T1 runs first and prints 1, T2 runs next and prints 2
(c) T2 runs first and prints 1, T1 runs next and prints 2
(d) T1 runs first and prints 1. T2 does not print anything (deadlock)
Sol. (*) PAGE
26

PW Mobile APP: https://smart.link/7wwosivoicgd4 https://t.me/Gwcomsciandinfo

https://www.youtube.com/@GATEWallah_EE_EC_CS https://www.youtube.com/@GATEWallahbyPW
[NAT]
Q.50. Consider the following augmented grammar, which is to be parsed with a SLR parser.
The set of terminals is {a, b, c, d, #, @}
S' → S
S → SS |Aa| |bAc. |Bc| |bBa
A → d#
B→@
COMPUTER SCIENCE & INFORMATION

Let Io = CLOSURE({S' → •S)). The number of items in the set GOTO(Io, S) is _____.
Sol. (*)

[MCQ]
Q.51. Let x and y be random variables, not necessarily independent, that take real values in
the interval [0,1]. Let z = xy and let the mean values of x, y, z be x , y , z respectively.
Which one of the following statements is TRUE?
(a) zx y (b) z x y
TECHNOLOGY

(c) z x (d) z =x y
Sol. (*)
[MCQ]
Q.52. You are given a set V of distinct integers. A binary search tree T is created by inserting
all elements of V one by one, starting with an empty tree. The tree T follows the
convention that, at each node, all values stored in the left subtree of the node are smaller
than the value stored at the node. You are not aware of the sequence in which these
values were inserted into T. and you do not have access to T.
Which one of the following statements is TRUE?
(a) Postorder traversal of T can be determined from V
(b) Inorder traversal of T can be determined from V
(c) Root node of T can be determined from V
(d) Preorder traversal of T can be determined from V
Sol. (b)

Since, it is given that we have distinct integers and at each node, all the values stored in
left subtree are smaller than the node. We know, the inorder traversal of a tree is
ascending order of the keys. So, Inorder traversal of T can be determined from V.
Therefore, option B is correct.

[MCQ]
Q.53. The relation schema. Person (pid, city), describes the city of residence for every person
uniquely identified by pid. The following relational algebra operators are available:
selection, projection, cross product, and rename. PAGE
27

PW Mobile APP: https://smart.link/7wwosivoicgd4 https://t.me/Gwcomsciandinfo

https://www.youtube.com/@GATEWallah_EE_EC_CS https://www.youtube.com/@GATEWallahbyPW
To find the list of cities where at least 3 persons reside, using the above operators. the
minimum number of cross product operations that must be used is
(a) 3 (b) 2
(c) 1 (d) 4
Sol. (*)

[MCQ]
COMPUTER SCIENCE & INFORMATION

Q.54. Consider a context-free grammar G with the following 3 rules.


𝑆 →𝑎𝑠, 𝑆→𝑎𝑆𝑏𝑆, 𝑆 →𝑐
Let w ∈ L(G). Let na (w), nb (w), nc (w) denote the number of times a, b, c occur in w,
respectively. Which of the following statements is/are TRUE?
(a) 𝑛𝑐 (𝑤)=𝑛𝑏 (𝑤)∗2 (b) 𝑛𝑎 (𝑤)>𝑛𝑏 (𝑤)
(c) 𝑛𝑎 (𝑤)>𝑛𝑐 (𝑤) –2 (d) 𝑛𝑐 (𝑤)=𝑛𝑏 (𝑤)+1
Sol. (*)

[NAT]
TECHNOLOGY

Q.55. A functional dependency F: X → Y is termed as a useful functional dependency if and


only if it satisfies all the following three conditions:

X is not the empty set.


Y is not the empty set.
Intersection of X and Y is the empty set.
For a relation R with 4 attributes, the total number of possible useful functional
dependencies is ____________.
Sol. (50)
x→y
4
(1) C1 × (1×(23 –1))
4 × 7 = 28
4
(2) C2 × (1×(22 –1))
6 × 3 = 18
4
(3) C3 × (1×(21 –1))
4×1=4
Total useful FD’s = 28 + 18 + 4 = 50



PAGE
28

PW Mobile APP: https://smart.link/7wwosivoicgd4 https://t.me/Gwcomsciandinfo

https://www.youtube.com/@GATEWallah_EE_EC_CS https://www.youtube.com/@GATEWallahbyPW

You might also like