CS and IT Gate 2025 Set-1 Questions with Answer

Ques 14 GATE 2025 SET-1


Suppose a message of size 15000 bytes is transmitted from a source to a destination using IPv4 protocol via two routers as shown in the figure. Each router has a defined maximum transmission unit (MTU) as shown in the figure, including IP header. The number of fragments that will be delivered to the destination is ______ (Answer in integer)


(6) is the correct answer.

Ques 15 GATE 2025 SET-1


Suppose a program is running on a non-pipelined single processor computer system. The computer is connected to an external device that can interrupt the processor asynchronously. The processor needs to execute the interrupt service routine (ISR) to serve this interrupt. The following steps (not necessarily in order) are taken by the processor when the interrupt arrives:
(i) The processor saves the content of the program counter.
(ii) The program counter is loaded with the start address of the ISR.
(iii) The processor finishes the present instruction.
Which ONE of the following is the CORRECT sequence of steps?

A

(iii), (i), (ii)

B

(i), (iii), (ii)

C

(i), (ii), (iii)

D

(iii), (ii), (i)


(a) is the correct answer.

Ques 16 GATE 2025 SET-1


The number -6 can be represented as 1010 in 4-bit 2's complement representation. Which of the following is/are CORRECT 2's complement representation(s) of -6?

A

1000 1010 in 8-bits

B

1111 1010 in 8-bits

C

1000 0000 0000 1010 in 16-bits

D

1111 1111 1111 1010 in 16-bits


(b) is the correct answer.

Ques 17 GATE 2025 SET-1


A partial data path of a processor is given in the figure, where RA, RB, and RZ are 32-bit registers. Which option(s) is/are CORRECT related to arithmetic operations using the data path as shown?

A

The data path can implement arithmetic operations involving two registers.

B

The data path can implement arithmetic operations involving one register and one immediate value.

C

The data path can implement arithmetic operations involving two immediate values.

D

The data path can only implement arithmetic operations involving one register and one immediate value.


(a) is the correct answer.

Ques 18 GATE 2025 SET-1


Consider a memory system with 1M bytes of main memory and 16K bytes of cache memory. Assume that the processor generates 20-bit memory address, and the cache block size is 16 bytes. If the cache uses direct mapping, how many bits will be required to store all the tag values? [Assume memory is byte addressable, 1K=210, 1M=220.]

A

6×210

B

8×210

C

212

D

214


(b) is the correct answer.

Ques 19 GATE 2025 SET-1


A processor has 64 general-purpose registers and 50 distinct instruction types. An instruction is encoded in 32-bits. What is the maximum number of bits that can be used to store the immediate operand for the given instruction?
ADD R1, #25 //R1=R1+25

A

16

B

20

C

22

D

24


(c) is the correct answer.

Ques 20 GATE 2025 SET-1


A computer has a memory hierarchy consisting of two-level cache (L1 and L2) and a main memory. If the processor needs to access data from memory, it first looks into L1 cache. If the data is not found in L1 cache, it goes to L2 cache. If it fails to get the data from L2 cache, it goes to main memory, where the data is definitely available. Hit rates and access times of various memory units are shown in the figure. The average memory access time in nanoseconds (ns) is ______ (rounded off to two decimal places)


(10.55) is the correct answer.

Ques 21 GATE 2025 SET-1


Which of the following statement(s) is/are TRUE for any binary search tree (BST) having n distinct integers?

A

The maximum length of a path from the root node to any other node is (n-1).

B

An inorder traversal will always produce a sorted sequence of elements.

C

Finding an element takes O(log2n) time in the worst case.

D

Every BST is also a Min-Heap.


(a and b) is the correct answer.

Statement A: The maximum length of a path from the root node to any other node is (n-1).
Analysis: In a skewed BST (all nodes in a single line), the path from root to the deepest node has (n-1) edges.
Example: BST with nodes 1→2→3→4→5 has maximum path length = 4 = (5-1)
Result: TRUE ✓

Statement B: An inorder traversal will always produce a sorted sequence of elements.
Analysis: By definition of BST, left subtree < root < right subtree. Inorder traversal (Left→Root→Right) always visits nodes in ascending order.
Example: BST with root 5, left child 3, right child 7 gives inorder: 3, 5, 7 (sorted)
Result: TRUE ✓

Statement C: Finding an element takes O(log₂n) time in the worst case.
Analysis: In the worst case, BST becomes skewed (like a linked list) and finding an element takes O(n) time, not O(log₂n).
O(log₂n) is only for balanced BST, not for any BST.
Result: FALSE ✗

Statement D: Every BST is also a Min-Heap.
Analysis: Min-Heap property: parent < both children (for all nodes).
BST property: left child < parent < right child.
In BST, the right child can be greater than parent, violating Min-Heap property.
Example: BST with root 5, left child 3, right child 7. Here 7 > 5, so not a Min-Heap.
Result: FALSE ✗

Answer: A and B are TRUE

Ques 22 GATE 2025 SET-1


The height of any rooted tree is defined as the maximum number of edges in the path from the root node to any leaf node.
Suppose a Min-Heap T stores 32 keys. The height of T is ______ (Answer in integer)


(5) is the correct answer.

Given: Min-Heap with 32 keys

Min-Heap structure:
A Min-Heap is a complete binary tree where every node is smaller than its children.

Formula for height of complete binary tree
For a complete binary tree with n nodes:
Height (h) = ⌊log₂(n)⌋

where ⌊ ⌋ means floor function (round down)

Calculating the height
Number of nodes (n) = 32

Height = ⌊log₂(32)⌋
Height = ⌊log₂(2⁵)⌋
Height = ⌊5⌋
Height = 5

Verification:
A complete binary tree of height 5 has:
- Minimum nodes = 2⁵ = 32 nodes
- Maximum nodes = 2⁶ - 1 = 63 nodes

Since we have exactly 32 nodes, height = 5

Answer: 5

Ques 23 GATE 2025 SET-1


In a double hashing scheme, h1(k)=k mod 11 and h2(k)=1+(k mod 7) are the auxiliary hash functions. The size m of the hash table is 11. The hash function for the i-th probe in the open address table is [h1(k)+i h2(k)] mod m. The following keys are inserted in the given order: 63, 50, 25, 79, 67, 24.
The slot at which key 24 gets stored is ______ (Answer in integer)


(3) is the correct answer.

Ques 24 GATE 2025 SET-1


A schedule of three database transactions T1, T2, and T3 is shown.
Ri(A) and Wi(A) denote read and write of data item A by transaction Ti,i=1,2,3.
The transaction T1 aborts at the end. Which other transaction(s) will be required to be rolled back?
R1(X)W1(Y)R2(X)R2(Y)R3(Y)ABORT(T1)

A

Only T2

B

Only T3

C

Both T2 and T3

D

Neither T2 nor T3


(c) is the correct answer.

Ques 25 GATE 2025 SET-1


Consider the following B+ tree with 5 nodes, in which a node can store at most 3 key values. The value 23 is now inserted in the B+ tree. Which of the following options(s) is/are CORRECT?

A

None of the nodes will split.

B

At least one node will split and redistribute.

C

The total number of nodes will remain same.

D

The height of the tree will increase.


(b) is the correct answer.

Ques 26 GATE 2025 SET-1


Consider two relations describing teams and players in a sports league:
• teams (tid, tname): tid, tname are team-id and team-name, respectively
• players (pid, pname, tid): pid, pname, and tid denote player-id, player-name and the team-id of the player, respectively
Which ONE of the following tuple relational calculus queries returns the name of the players who play for the team having tname as 'MI'?

A

{ p.pname | p ∈ players ∃t (t ∈ teams &land; p.tid = t.tid &land; t.tname = 'MI')}

B

{p.pname | p∈ teams ∃t (t ∈ players &land; p.tid = t.tid &land; t.tname = 'MI')}

C

{ p.pname | p ∈ players ∃t (t ∈ teams &land; t.tname = 'MI')}

D

{p.pname | p∈ teams ∃t (t∈ players &land; t.tname = 'MI')}


(a) is the correct answer.

Unique Visitor Count

Total Unique Visitors

Loading......