GATE 2025 (Session 1)
65 questions
MCQ 30 · MSQ 13 · NAT 221-mark 30 · 2-mark 35
Questions 21–25 of 65
Consider the following tree with 5 nodes, in which a node can store at most 3 key values. The value 23 is now inserted in the tree. Which of the following options(s) is/are CORRECT?
One or more options are correct.
Answer: (B), (D)
Since , the key goes to the last leaf . That leaf already has 3 keys, the maximum, so it overflows to and splits into and . The separator 22 goes up to the root.
The root is also full, so adding 22 gives four keys and the root splits too: and , with 19 moving up into a new root . The new root adds a level, so the height goes up by one.
Number of nodes: before, 1 root and 4 leaves, which is 5. After, there are 5 leaves, 2 internal nodes below the new root, and the new root, which is 8.
(A) is false: the leaf and the root both split. (B) is true. (C) is false: 5 nodes become 8. (D) is true.
(The first leaf is printed as 1, 4, 3 in the paper, out of order; this leaf is not touched by the insertion, so the answer does not depend on it.)
Answer: (B), (D)
The root is also full, so adding 22 gives four keys and the root splits too: and , with 19 moving up into a new root . The new root adds a level, so the height goes up by one.
Number of nodes: before, 1 root and 4 leaves, which is 5. After, there are 5 leaves, 2 internal nodes below the new root, and the new root, which is 8.
(A) is false: the leaf and the root both split. (B) is true. (C) is false: 5 nodes become 8. (D) is true.
(The first leaf is printed as 1, 4, 3 in the paper, out of order; this leaf is not touched by the insertion, so the answer does not depend on it.)
Answer: (B), (D)
Consider the 3-way handshaking protocol for TCP connection establishment. Let the three packets exchanged during the connection establishment be denoted as P1, P2, and P3, in order. Which of the following option(s) is/are TRUE with respect to TCP header flags that are set in the packets?
One or more options are correct.
Answer: (B), (D)
Here is the TCP 3-way handshake, one packet at a time:
- P1 (client → server): The client starts the connection with SYN=1. ACK=0 because there is nothing to acknowledge yet.
- P2 (server → client): The server acknowledges the client's SYN and sends its own SYN. So both flags are set: SYN=1, ACK=1. This SYN-ACK packet is the hallmark of the TCP handshake.
- P3 (client → server): The client only has to acknowledge the server's SYN. So the flags are SYN=0, ACK=1. They are not SYN=1, ACK=1 as one wrong option says.
So the correct flags are P1: SYN=1, and P2: SYN=1 & ACK=1.
Answer: P2 (SYN=1, ACK=1), and P1 (SYN=1)
- P1 (client → server): The client starts the connection with SYN=1. ACK=0 because there is nothing to acknowledge yet.
- P2 (server → client): The server acknowledges the client's SYN and sends its own SYN. So both flags are set: SYN=1, ACK=1. This SYN-ACK packet is the hallmark of the TCP handshake.
- P3 (client → server): The client only has to acknowledge the server's SYN. So the flags are SYN=0, ACK=1. They are not SYN=1, ACK=1 as one wrong option says.
So the correct flags are P1: SYN=1, and P2: SYN=1 & ACK=1.
Answer: P2 (SYN=1, ACK=1), and P1 (SYN=1)
Consider the given system of linear equations for variables and , where is a real-valued constant. Which of the following option(s) is/are CORRECT?
One or more options are correct.
Answer: (A), (D)
The system is , and its determinant is .
No solution needs (that is, ). The two equations must also contradict each other (parallel lines that are not the same line):
- : the equations become and . These lines are parallel and contradict each other, so there is no solution.
- : the equations become and . The second is the first multiplied by . It is the same line, so there are infinitely many solutions, not "no solution."
So exactly one value of , namely , gives no solution. Exactly one value of , namely , gives infinitely many solutions. For every other (that is, ), we have and the solution is unique. But this holds for infinitely many values of , not just one. So the claim "exactly one k gives a unique solution" is false.
Answer: Exactly one k gives no solution; and exactly one k gives infinitely many solutions.
No solution needs (that is, ). The two equations must also contradict each other (parallel lines that are not the same line):
- : the equations become and . These lines are parallel and contradict each other, so there is no solution.
- : the equations become and . The second is the first multiplied by . It is the same line, so there are infinitely many solutions, not "no solution."
So exactly one value of , namely , gives no solution. Exactly one value of , namely , gives infinitely many solutions. For every other (that is, ), we have and the solution is unique. But this holds for infinitely many values of , not just one. So the claim "exactly one k gives a unique solution" is false.
Answer: Exactly one k gives no solution; and exactly one k gives infinitely many solutions.
Let be a 3-variable Boolean function that produces output as '1' when at least two of the input variables are '1'. Which of the following statement(s) is/are CORRECT, where are Boolean variables?
One or more options are correct.
Answer: (B), (D)
is the majority function: it gives 1 when at least two of its three inputs are 1. If two inputs are the same variable , the output is , whatever the third input is.
(B) Let . If , then and . If , one of them is 0 and the other is 1, so and . True.
(D) . Let . If , then and . If , then and . True.
(A) Take . Left side: . Right side: . They differ, so False.
(C) Here and , so the right side is . Take . Left side: . Right side: . They differ, so False.
Answer: (B), (D)
(B) Let . If , then and . If , one of them is 0 and the other is 1, so and . True.
(D) . Let . If , then and . If , then and . True.
(A) Take . Left side: . Right side: . They differ, so False.
(C) Here and , so the right side is . Take . Left side: . Right side: . They differ, so False.
Answer: (B), (D)
The number 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 ?
One or more options are correct.
Answer: (B), (D)
To extend a two's-complement number to more bits, you must use sign-extension. Copy the sign bit (here the leading , because is negative) into every new high-order bit. You cannot just add any bits or zeros in front.
in 4 bits is .
Correct 8-bit sign-extension: (four 's added in front). The other choice adds in front instead of copying the sign bit, so it is wrong.
Correct 16-bit sign-extension: (twelve 's added in front). The other choice is wrong in the same way.
Answer: 1111 1010 (8-bit) and 1111 1111 1111 1010 (16-bit)
in 4 bits is .
Correct 8-bit sign-extension: (four 's added in front). The other choice adds in front instead of copying the sign bit, so it is wrong.
Correct 16-bit sign-extension: (twelve 's added in front). The other choice is wrong in the same way.
Answer: 1111 1010 (8-bit) and 1111 1111 1111 1010 (16-bit)