>
GATE CS
List of top Questions asked in GATE CS
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?
GATE CS - 2024
GATE CS
Computer Networks
Miscellaneous
Consider the following C function definition.
\begin{verbatim} int fX(char *a){ char *b = a; while(*b) b++; return b - a; } \end{verbatim}
Which of the following statements is/are TRUE?
GATE CS - 2024
GATE CS
Programming and Data Structure
Circular Linked List
Let \(P\) be the partial order defined on the set \(\{1, 2, 3, 4\}\) as follows:
\[ P = \{(x, x) \mid x \in \{1, 2, 3, 4\}\} \cup \{(1, 2), (3, 2), (3, 4)\} \]
The number of total orders on \(\{1, 2, 3, 4\}\) that contain \(P\) is ...........\_\_\_.
GATE CS - 2024
GATE CS
General Aptitude
Data Interpretation
What is the output of the following C program?
\begin{verbatim} #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)(*q - *p)); return 0; } \end{verbatim}
GATE CS - 2024
GATE CS
Miscellaneous
Miscellaneous
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 ...........\_\_\_.
GATE CS - 2024
GATE CS
Compiler Design
Syntax Directed Translation
Which of the following fields of an IP header is/are always
modified by any router before it forwards the IP packet?}
GATE CS - 2024
GATE CS
Miscellaneous
Miscellaneous
Which of the following statements is/are FALSE
?}
GATE CS - 2024
GATE CS
Computer Organization and Architecture
Indexed Address
For a Boolean variable \(x\), which of the following statements is/are FALSE
?}
GATE CS - 2024
GATE CS
Mathematics
Mathematical Logic
An instruction format has the following structure:
\begin{center} Instruction Number: Opcode destination reg, source reg-1, source reg-2} \end{center}
Consider the following sequence of instructions to be executed in a pipelined processor:
I\(_1\):
DIV R3, R1, R2
I\(_2\):
SUB R5, R3, R4
I\(_3\):
ADD R3, R5, R6
I\(_4\):
MUL R7, R3, R8
Which of the following statements is/are TRUE?
GATE CS - 2024
GATE CS
Computer Organization and Architecture
Implied Mode
Which of the following statements about IPv4 fragmentation is/are TRUE?
GATE CS - 2024
GATE CS
Miscellaneous
Miscellaneous
Which of the following statements about the Two Phase Locking (2PL) protocol is/are TRUE?
GATE CS - 2024
GATE CS
Miscellaneous
Miscellaneous
Consider a process \(P\) running on a 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)?}
GATE CS - 2024
GATE CS
Compiler Design
Lexical analysis
Which of the following file organizations is/are I/O efficient
for the scan operation in DBMS?}
GATE CS - 2024
GATE CS
Computer Networks
Miscellaneous
Node X has a TCP connection open to node Y. The packets from X to Y go through an 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.
Which of the following statements is/are TRUE about the destination IP and MAC addresses on this packet at the time it leaves X?
GATE CS - 2024
GATE CS
Computer Organization and Architecture
Indexed Address
Which one of the following regular expressions is equivalent to the language accepted by the DFA given below?
\begin{center} \includegraphics[width=6cm]{22.png} \end{center}
GATE CS - 2024
GATE CS
DBMS
Miscellaneous
Which of the following tasks is/are the responsibility/responsibilities of the memory management unit (MMU) in a system with paging-based memory management?
GATE CS - 2024
GATE CS
Compiler Design
Lexical analysis
Consider the following two sets:
\begin{center} \begin{tabular}{|c|l|c|l|} \hline
Set X
& &
Set Y
&
\hline 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
\hline \end{tabular} \end{center}
Which one of the following options is the CORRECT match from Set X to Set Y?
GATE CS - 2024
GATE CS
Compiler Design
Syntax Directed Translation
In the context of owner and weak entity sets in the ER (Entity-Relationship) data model, which one of the following statements is TRUE?
GATE CS - 2024
GATE CS
Computer Networks
Miscellaneous
Let \( A \) be the adjacency matrix of a simple undirected graph \( G \). Suppose \( A \) is its own inverse. Which one of the following statements is always TRUE?
GATE CS - 2024
GATE CS
General Aptitude
Data Interpretation
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
GATE CS - 2024
GATE CS
Miscellaneous
Miscellaneous
When six unbiased dice are rolled simultaneously, the probability of getting all distinct numbers (i.e., \( 1, 2, 3, 4, 5, \) and \( 6 \)) is
GATE CS - 2024
GATE CS
General Aptitude
Data Interpretation
The format of a single-precision floating-point number as per the IEEE 754
standard is:} \begin{center} \begin{tabular}{|c|c|c|} \hline
Sign (1 bit)
&
Exponent (8 bits)
&
Mantissa (23 bits)
\hline \end{tabular} \end{center}
Choose the largest floating-point number among the following options:
GATE CS - 2024
GATE CS
Computer Organization and Architecture
Implied Mode
Consider the following C program. Assume parameters to a function are evaluated from right to left
.} \begin{verbatim} #include stdio.h int g(int p) { printf("%d", p); return p; } int h(int q) { printf("%d", q); return q; } void f(int x, int y) { g(x); h(y); } int main() { f(g(10), h(20)); } \end{verbatim}
Which one of the following options is the CORRECT output of the above C program?
GATE CS - 2024
GATE CS
Programming and Data Structure
Circular Linked List
Let \( f(x) \) be a continuous function from \( \mathbb{R} \) to \( \mathbb{R} \) such that:
\[ f(x) = 1 - f(2 - x) \]
Which one of the following options is the CORRECT value of \( \int_0^2 f(x) \, dx \)?
GATE CS - 2024
GATE CS
Mathematics
Mathematical Logic
Let \( T(n) \) be the recurrence relation defined as follows:
\[ T(0) = 1, \quad T(1) = 2, \quad T(n) = 5T(n-1) - 6T(n-2) \quad \text{for } n \geq 2 \]
Which one of the following statements is TRUE?
GATE CS - 2024
GATE CS
Computer Organization and Architecture
Indexed Address
Prev
1
...
7
8
9
10
11
...
13
Next