Computer Science and Information Technology
2021 · Paper 1
Take it one question at a time. Try an answer, then check your understanding.
Complete GATE CSE 2021 Paper 1 overview, original pages and practice · Timed previous-paper practice
Questions 55–57 of 65. Imported answers require review unless explicitly marked reviewed.
Question 45
Open questionCSMSQ2 marksNeeds review
Consider two hosts
and
connected through a router
. The maximum transfer unit (MTU) value of the link between
and
is 1500 bytes, and between
and
is 820 bytes. A TCP segment of size 1400 bytes was transferred from
to
through
, with IP identification value as 0x1234. Assume that the IP header size is 20 bytes. Further, the packet is allowed to be fragmented, i.e., Don’t Fragment (DF) flag in the IP header is not set by
. Which of the following statements is/are correct?Your answerSelect all correct options. You can choose more than one.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 46
Open questionCSMSQ2 marksNeeds review
Consider the following pseudocode, where S is a semaphore initialized to 5 in line#2 and counter is a shared variable initialized to 0 in line#1. Assume that the increment operation in line#7 is not atomic.
int counter = 0;
Semaphore S = init(5);
void parop(void)
{
wait(S);
wait(S);
counter++;
signal(S);
signal(S);
}
If five threads execute the function parop concurrently, which of the following program behavior(s) is/are possible?
Your answerSelect all correct options. You can choose more than one.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 47
Open questionCSMSQ2 marksNeeds review
Consider a dynamic hashing approach for 4-bit integer keys:
There is a main hash table of size 4.
The 2 least significant bits of a key is used to index into the main hash table.
Initially, the main hash table entries are empty.
Thereafter, when more keys are hashed into it, to resolve collisions, the set of all keys corresponding to a main hash table entry is organized as a binary tree that grows on demand.
First, the 3rd least significant bit is used to divide the keys into left and right subtrees.
To resolve more collisions, each node of the binary tree is further sub-divided into left and right subtrees based on the 4th least significant bit.
A split is done only if it is needed, i.e., only when there is a collision.
Consider the following state of the hash table.
Which of the following sequences of key insertions can cause the above state of the hash table (assume the keys are in decimal notation)?

Your answerSelect all correct options. You can choose more than one.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer