Subjects in this paper

GATE CS 2025 CS-2 questions

Q1

Verbal AptitudeMCQ1 mark−1/3 if wrong
Despite his initial hesitation, Rehman’s _________ to contribute to the success of the project never wavered.

Select the most appropriate option to complete the above sentence.
Show answer without attempting

Answer: C

Q2

Analytical AptitudeMCQ1 mark−1/3 if wrong
Bird : Nest :: Bee : _______

Select the correct option to complete the analogy.
Show answer without attempting

Answer: C

Q3

Quantitative AptitudeMCQ1 mark−1/3 if wrong
If Pex=Qe−xPe^{x} = Qe^{-x} for all real values of xx, which one of the following statements is true?
Show answer without attempting

Answer: A

Q4

Spatial AptitudeMCQ1 mark−1/3 if wrong
The paper as shown in the figure is folded to make a cube where each square corresponds to a particular face of the cube. Which one of the following options correctly represents the cube?

Note: The figures shown are representative.
Question figure
Show answer without attempting

Answer: A

Q5

Quantitative AptitudeMCQ1 mark−1/3 if wrong
Let p1p_1 and p2p_2 denote two arbitrary prime numbers. Which one of the following statements is correct for all values of p1p_1 and p2p_2?
Show answer without attempting

Answer: B

Q6

Analytical AptitudeMCQ2 marks−2/3 if wrong
Based only on the conversation below, identify the logically correct inference:

“Even if I had known that you were in the hospital, I would not have gone there to see you”, Ramya told Josephine.
Show answer without attempting

Answer: B

Q7

Analytical AptitudeMCQ2 marks−2/3 if wrong
If IMAGE and FIELD are coded as FHBNJ and EMFJG respectively then, which one among the given options is the most appropriate code for BEACH ?
Show answer without attempting

Answer: B

Q8

Quantitative AptitudeMCQ2 marks−2/3 if wrong
Which one of the following options is correct for the given data in the table?
Iteration (i)0123
Input (I)20−41015
Output (X)20162641
Output (Y)20−80−800−12000
Show answer without attempting

Answer: A

Q9

Quantitative AptitudeMCQ2 marks−2/3 if wrong
In the given figure, PQRS is a square of side 2 cm and PLMN is a rectangle. The corner L of the rectangle is on the side QR. Side MN of the rectangle passes through the corner S of the square.

What is the area (in cm2\text{cm}^2) of the rectangle PLMN?

Note: The figure shown is representative.
Question figure
Show answer without attempting

Answer: D

Q10

Analytical AptitudeMCQ2 marks−2/3 if wrong
The diagram below shows a river system consisting of 7 segments, marked P, Q, R, S, T, U, and V. It splits the land into 5 zones, marked Z1, Z2, Z3, Z4, and Z5. We need to connect these zones using the least number of bridges. Out of the following options, which one is correct?

Note: The figure shown is representative.
Question figure
Show answer without attempting

Answer: C

Q11

Linear AlgebraMCQ1 mark−1/3 if wrong
If A=(122−1)A = \begin{pmatrix} 1 & 2 \\ 2 & -1 \end{pmatrix}, then which ONE of the following is A8A^8?
Show answer without attempting

Answer: C

Q12

CalculusMCQ1 mark−1/3 if wrong
The value of xx such that x>1x > 1, satisfying the equation ∫1xtln⁡t dt=14\int_{1}^{x} t \ln t \, dt = \frac{1}{4} is
Show answer without attempting

Answer: A

Q13

Tree Data StructuresMCQ1 mark−1/3 if wrong
Consider a binary tree TT in which every node has either zero or two children. Let n>0n > 0 be the number of nodes in TT.

Which ONE of the following is the number of nodes in TT that have exactly two children?
Show answer without attempting

Answer: B

Q14

Linear AlgebraMCQ1 mark−1/3 if wrong
Let LL, MM, and NN be non-singular matrices of order 3 satisfying the equations
L2=L−1L^2 = L^{-1}, M=L8M = L^8 and N=L2N = L^2.

Which ONE of the following is the value of the determinant of (M−N)(M - N)?
Show answer without attempting

Answer: A

Q15

Discrete MathematicsMCQ1 mark−1/3 if wrong
Let P(x)P(x) be an arbitrary predicate over the domain of natural numbers.

Which ONE of the following statements is TRUE?
Show answer without attempting

Answer: A

Q16

Transport LayerMCQ1 mark−1/3 if wrong
Consider the following statements:

(i) Address Resolution Protocol (ARP) provides a mapping from an IP address to the corresponding hardware (link-layer) address.
(ii) A single TCP segment from a sender S to a receiver R cannot carry both data from S to R and acknowledgement for a segment from R to S.

Which ONE of the following is CORRECT?
Show answer without attempting

Answer: B

Q17

RoutingMCQ1 mark−1/3 if wrong
Consider the routing protocols given in List I and the names given in List II:
List IList II
(i) Distance vector routing(a) Bellman-Ford
(ii) Link state routing(b) Dijkstra
For matching of items in List I with those in List II, which ONE of the following options is CORRECT?
Show answer without attempting

Answer: A

Q18

IPv4MCQ1 mark−1/3 if wrong
A machine receives an IPv4 datagram. The protocol field of the IPv4 header has the protocol number of a protocol X.

Which ONE of the following is NOT a possible candidate for X?
Show answer without attempting

Answer: D

Q19

C ProgrammingMCQ1 mark−1/3 if wrong
Consider the following C program:
#include <stdio.h>
void stringcopy(char *, char *);
int main(){
    char a[30] = "@#Hello World!";
    stringcopy(a, a + 2);
    printf("%s\n", a);
    return 0;
}
void stringcopy(char *s, char *t) {
    while(*t)
        *s++ = *t++;
}
Which ONE of the following will be the output of the program?
Show answer without attempting

Answer: D

Q20

Searching Sorting and HashingMCQ1 mark−1/3 if wrong
Consider an unordered list of NN distinct integers.

What is the minimum number of element comparisons required to find an integer in the list that is NOT the largest in the list?
Show answer without attempting

Answer: A

Q21

Intermediate CodeMCQ1 mark−1/3 if wrong
Consider the following statements about the use of backpatching in a compiler for intermediate code generation:

(I) Backpatching can be used to generate code for Boolean expression in one pass.
(II) Backpatching can be used to generate code for flow-of-control statements in one pass.

Which ONE of the following options is CORRECT?
Show answer without attempting

Answer: C

Q22

Syntax Directed TranslationMCQ1 mark−1/3 if wrong
Given the following syntax directed translation rules:

Rule 1: R→AB{B.i=R.i−1;A.i=B.i;R.i=A.i+1;}R \rightarrow AB \{B.i = R.i - 1; A.i = B.i; R.i = A.i + 1;\}
Rule 2: P→CD{P.i=C.i+D.i;D.i=C.i+2;}P \rightarrow CD \{P.i = C.i + D.i; D.i = C.i + 2;\}
Rule 3: Q→EF{Q.i=E.i+F.i;}Q \rightarrow EF \{Q.i = E.i + F.i;\}

Which ONE is the CORRECT option among the following?
Show answer without attempting

Answer: C

Q23

IPv4MCQ1 mark−1/3 if wrong
Consider a network that uses Ethernet and IPv4. Assume that IPv4 headers do not use any options field. Each Ethernet frame can carry a maximum of 1500 bytes in its data field. A UDP segment is transmitted. The payload (data) in the UDP segment is 7488 bytes.

Which ONE of the following choices has the CORRECT total number of fragments transmitted and the size of the last fragment including IPv4 header?
Show answer without attempting

Answer: D

Q24

Context Free LanguagesMCQ1 mark−1/3 if wrong
Which ONE of the following languages is accepted by a deterministic pushdown automaton?
Show answer without attempting

Answer: A

Q25

ComputabilityMCQ1 mark−1/3 if wrong
Let G1,G2G_1, G_2 be Context Free Grammars (CFGs) and RR be a regular expression. For a grammar GG, let L(G)L(G) denote the language generated by GG.

Which ONE among the following questions is decidable?
Show answer without attempting

Answer: D

Q26

SchedulingMCQ1 mark−1/3 if wrong
Processes P1,P2,P3,P4P1, P2, P3, P4 arrive in that order at times 0, 1, 2, and 8 milliseconds respectively, and have execution times of 10, 13, 6, and 9 milliseconds respectively. Shortest Remaining Time First (SRTF) algorithm is used as the CPU scheduling policy. Ignore context switching times.

Which ONE of the following correctly gives the average turnaround time of the four processes in milliseconds?
Show answer without attempting

Answer: D

Q27

TransactionsMSQ1 mark
An audit of a banking transactions system has found that on an earlier occasion, two joint holders of account AA attempted simultaneous transfers of Rs. 10000 each from account AA to account BB. Both transactions read the same value, Rs. 11000, as the initial balance in AA and were allowed to go through. BB was credited Rs. 10000 twice. AA was debited only once and ended up with a balance of Rs. 1000.

Which of the following properties is/are certain to have been violated by the system?
More than one option can be correct.
Show answer without attempting

Answer: B, C

Q28

Instruction Set and AddressingMSQ1 mark
Which of the following is/are part of an Instruction Set Architecture of a processor?
More than one option can be correct.
Show answer without attempting

Answer: D

Q29

Graph AlgorithmsMSQ1 mark
Which of the following statements regarding Breadth First Search (BFS) and Depth First Search (DFS) on an undirected simple graph G is/are TRUE?
More than one option can be correct.
Show answer without attempting

Answer: B, C, D

Q30

Context Free LanguagesMSQ1 mark
Consider the two lists List I and List II given below:
List IList II
(i) Context free languages(a) Closed under union
(ii) Recursive languages(b) Not closed under complementation
(iii) Regular languages(c) Closed under intersection
For matching of items in List I with those in List II, which of the following option(s) is/are CORRECT?
More than one option can be correct.
Show answer without attempting

Answer: B, C

Q31

Combinational CircuitsMSQ1 mark
Consider the following logic circuit diagram.

Which is/are the CORRECT option(s) for the output function FF?
Question figure
More than one option can be correct.
Show answer without attempting

Answer: A, B, C

Q32

Number Representation and ArithmeticNAT1 mark
The following two signed 2’s complement numbers (multiplicand M and multiplier Q) are being multiplied using Booth’s algorithm:

M: 1100 1101 1110 1101 and Q: 1010 0100 1010 1010

The total number of addition and subtraction operations to be performed is ___________. (Answer in integer)
Show answer without attempting

Answer: 13

Q33

C ProgrammingNAT1 mark
 int x=126,y=105;
 do {
 if(x>y) x=x-y;
 else y=y-x;
 } while(x!=y);
 printf("%d",x);
The output of the given C code segment is ________. (Answer in integer)
Show answer without attempting

Answer: 21

Q34

Sequential CircuitsNAT1 mark
In a 4-bit ripple counter, if the period of the waveform at the last flip-flop is 64 microseconds, then the frequency of the ripple counter in kHz is ________. (Answer in integer)
Show answer without attempting

Answer: 250

Q35

Tree Data StructuresNAT1 mark
Suppose the values 10,−4,15,30,20,5,60,1910, -4, 15, 30, 20, 5, 60, 19 are inserted in that order into an initially empty binary search tree. Let TT be the resulting binary search tree.
The number of edges in the path from the node containing 19 to the root node of TT is ___________. (Answer in integer)
Show answer without attempting

Answer: 4

Q36

Transport LayerMCQ2 marks−2/3 if wrong
Suppose we are transmitting frames between two nodes using Stop-and-Wait protocol. The frame size is 3000 bits. The transmission rate of the channel is 2000 bps (bits/second) and the propagation delay between the two nodes is 100 milliseconds. Assume that the processing times at the source and destination are negligible. Also, assume that the size of the acknowledgement packet is negligible.

Which ONE of the following most accurately gives the channel utilization for the above scenario in percentage?
Show answer without attempting

Answer: A

Q37

Graph AlgorithmsMCQ2 marks−2/3 if wrong
Let GG be an edge-weighted undirected graph with positive edge weights. Suppose a positive constant α\alpha is added to the weight of every edge.

Which ONE of the following statements is TRUE about the minimum spanning trees (MSTs) and shortest paths (SPs) in GG before and after the edge weight update?
Show answer without attempting

Answer: C

Q38

Linear Data StructuresMCQ2 marks−2/3 if wrong
A meld operation on two instances of a data structure combines them into one single instance of the same data structure. Consider the following data structures:

P: Unsorted doubly linked list with pointers to the head node and tail node of the list.
Q: Min-heap implemented using an array.
R: Binary Search Tree.

Which ONE of the following options gives the worst-case time complexities for meld operation on instances of size nn of these data structures?
Show answer without attempting

Answer: A

Q39

Memory HierarchyMCQ2 marks−2/3 if wrong
For a direct-mapped cache, 4 bits are used for the tag field and 12 bits are used to index into a cache block. The size of each cache block is one byte. Assume that there is no other information stored for each cache block.

Which ONE of the following is the CORRECT option for the sizes of the main memory and the cache memory in this system (byte addressable), respectively?
Show answer without attempting

Answer: A

Q40

ParsingMCQ2 marks−2/3 if wrong
Given a Context-Free Grammar GG as follows:

S→Aa∣bAc∣dc∣bdaS \rightarrow Aa \mid bAc \mid dc \mid bda
A→dA \rightarrow d

Which ONE of the following statements is TRUE?
Show answer without attempting

Answer: C

Q41

Algorithm AnalysisMCQ2 marks−2/3 if wrong
An array AA of length nn with distinct elements is said to be bitonic if there is an index 1≤i≤n1 \le i \le n such that A[1…i]A[1 \dots i] is sorted in the non-decreasing order and A[i+1…n]A[i+1 \dots n] is sorted in the non-increasing order.

Which ONE of the following represents the best possible asymptotic bound for the worst-case number of comparisons by an algorithm that searches for an element in a bitonic array AA?
Show answer without attempting

Answer: D

Q42

Discrete MathematicsMSQ2 marks
Let F\mathcal{F} be the set of all functions from {1,…,n}\{1, \dots, n\} to {0,1}\{0,1\}. Define the binary relation ≼\preccurlyeq on F\mathcal{F} as follows:

∀f,g∈F,f≼g\forall f, g \in \mathcal{F}, f \preccurlyeq g if and only if ∀x∈{1,…,n},f(x)≤g(x)\forall x \in \{1, \dots, n\}, f(x) \le g(x), where 0≤10 \le 1.

Which of the following statement(s) is/are TRUE?
More than one option can be correct.
Show answer without attempting

Answer: B, C

Q43

Boolean Algebra and MinimizationMSQ2 marks
Given the following Karnaugh Map for a Boolean function F(w,x,y,z)F(w, x, y, z):

Which one or more of the following Boolean expression(s) represent(s) FF?
Question figure
More than one option can be correct.
Show answer without attempting

Answer: A, D

Q44

Linear AlgebraMSQ2 marks
Consider a system of linear equations PX=QPX = Q where P∈R3×3P \in \mathbb{R}^{3 \times 3} and Q∈R3×1Q \in \mathbb{R}^{3 \times 1}. Suppose PP has an LU decomposition, P=LUP = LU, where
L=[100l2110l31l321]L = \begin{bmatrix} 1 & 0 & 0 \\ l_{21} & 1 & 0 \\ l_{31} & l_{32} & 1 \end{bmatrix} and U=[u11u12u130u22u2300u33]U = \begin{bmatrix} u_{11} & u_{12} & u_{13} \\ 0 & u_{22} & u_{23} \\ 0 & 0 & u_{33} \end{bmatrix}.

Which of the following statement(s) is/are TRUE?
More than one option can be correct.
Show answer without attempting

Answer: A, B, C

Q45

Linear Data StructuresMSQ2 marks
Consider a stack data structure into which we can PUSH and POP records. Assume that each record pushed in the stack has a positive integer key and that all keys are distinct.

We wish to augment the stack data structure with an O(1)O(1) time MIN operation that returns a pointer to the record with smallest key present in the stack
1) without deleting the corresponding record, and
2) without increasing the complexities of the standard stack operations.

Which one or more of the following approach(es) can achieve it?
More than one option can be correct.
Show answer without attempting

Answer: A

Q46

Relational DesignMSQ2 marks
Consider the following relational schema along with all the functional dependencies that hold on them.

R1(A,B,C,D,E):{D→E,EA→B,EB→C}R1(A, B, C, D, E): \{D \rightarrow E, EA \rightarrow B, EB \rightarrow C\}
R2(A,B,C,D):{A→D,A→B,C→A}R2(A, B, C, D): \{A \rightarrow D, A \rightarrow B, C \rightarrow A\}

Which of the following statement(s) is/are TRUE?
More than one option can be correct.
Show answer without attempting

Answer: C, D

Q47

Memory ManagementMSQ2 marks
Consider a demand paging system with three frames, and the following page reference string: 1  2  3  4  5  4  1  6  4  5  1  3  21 \; 2 \; 3 \; 4 \; 5 \; 4 \; 1 \; 6 \; 4 \; 5 \; 1 \; 3 \; 2. The contents of the frames are as follows initially and after each reference (from left to right), as shown in the table:

The *-marked references cause page replacements.

Which one or more of the following could be the page replacement policy/policies in use?
Question figure
More than one option can be correct.
Show answer without attempting

Answer: D

Q48

DeadlocksMSQ2 marks
P={P1,P2,P3,P4}P = \{P_1, P_2, P_3, P_4\} consists of all active processes in an operating system.
R={R1,R2,R3,R4}R = \{R_1, R_2, R_3, R_4\} consists of single instances of distinct types of resources in the system.

The resource allocation graph has the following assignment and claim edges.

Assignment edges: R1→P1,R2→P2,R3→P3,R4→P4R_1 \rightarrow P_1, R_2 \rightarrow P_2, R_3 \rightarrow P_3, R_4 \rightarrow P_4 (the assignment edge R1→P1R_1 \rightarrow P_1 means resource R1R_1 is assigned to process P1P_1, and so on for others)
Claim edges: P1→R2,P2→R3,P3→R1,P2→R4,P4→R2P_1 \rightarrow R_2, P_2 \rightarrow R_3, P_3 \rightarrow R_1, P_2 \rightarrow R_4, P_4 \rightarrow R_2 (the claim edge P1→R2P_1 \rightarrow R_2 means process P1P_1 is waiting for resource R2R_2, and so on for others)

Which of the following statement(s) is/are CORRECT?
More than one option can be correct.
Show answer without attempting

Answer: C, D

Q49

Number Representation and ArithmeticMSQ2 marks
Three floating point numbers XX, YY, and ZZ are stored in three registers RXR_X, RYR_Y, and RZR_Z, respectively in IEEE 754 single precision format as given below in hexadecimal:

RXR_X = 0xC1100000, RYR_Y = 0x40C00000, and RZR_Z = 0x41400000

Which of the following option(s) is/are CORRECT?
More than one option can be correct.
Show answer without attempting

Answer: A, B, C

Q50

Boolean Algebra and MinimizationMSQ2 marks
Which of the following Boolean algebraic equation(s) is/are CORRECT?
More than one option can be correct.
Show answer without attempting

Answer: B, C, D

Q51

ParsingMSQ2 marks
Consider two grammars G1G_1 and G2G_2 with the production rules given below:

G1:S→if E then S∣if E then S else S∣aG_1: S \rightarrow \text{if } E \text{ then } S \mid \text{if } E \text{ then } S \text{ else } S \mid a
E→bE \rightarrow b

G2:S→if E then S∣MG_2: S \rightarrow \text{if } E \text{ then } S \mid M
M→if E then M else S∣cM \rightarrow \text{if } E \text{ then } M \text{ else } S \mid c
E→bE \rightarrow b

where if,then,else,a,b,c\text{if}, \text{then}, \text{else}, a, b, c are the terminals.

Which of the following option(s) is/are CORRECT?
More than one option can be correct.
Show answer without attempting

Answer: C, D

Q52

Regular LanguagesMSQ2 marks
Let Σ={a,b,c}\Sigma = \{a, b, c\}. For x∈Σ∗x \in \Sigma^*, and α∈Σ\alpha \in \Sigma, let #α(x)\#_\alpha(x) denote the number of occurrences of α\alpha in xx.

Which one or more of the following option(s) define(s) regular language(s)?
More than one option can be correct.
Show answer without attempting

Answer: A, C

Q53

TransactionsMSQ2 marks
Consider the database transactions T1 and T2, and data items X and Y. Which of the schedule(s) is/are conflict serializable?

Transaction T1: R1(X), W1(Y), R1(X), W1(X), COMMIT(T1)
Transaction T2: W2(X), W2(Y), COMMIT(T2)
More than one option can be correct.
Show answer without attempting

Answer: B

Q54

Relational QueriesMSQ2 marks
Consider the following relational schema:

Students (rollno: integer‾\underline{\text{rollno: integer}}, name: string, age: integer, cgpa: real)
Courses (courseno: integer‾\underline{\text{courseno: integer}}, cname: string, credits: integer)
Enrolled (rollno: integer‾\underline{\text{rollno: integer}}, courseno: integer‾\underline{\text{courseno: integer}}, grade: string)

Which of the following options is/are correct SQL query/queries to retrieve the names of the students enrolled in course number (i.e., courseno) 1470?
More than one option can be correct.
Show answer without attempting

Answer: A, C, D

Q55

Memory HierarchyNAT2 marks
Given a computing system with two levels of cache (L1 and L2) and a main memory. The first level (L1) cache access time is 1 nanosecond (ns) and the “hit rate” for L1 cache is 90% while the processor is accessing the data from L1 cache. Whereas, for the second level (L2) cache, the “hit rate” is 80% and the “miss penalty” for transferring data from L2 cache to L1 cache is 10 ns. The “miss penalty” for the data to be transferred from main memory to L2 cache is 100 ns.

Then the average memory access time in this system in nanoseconds is ___________ . (rounded off to one decimal place)
Show answer without attempting

Answer: 4.0

Q56

Instruction PipeliningNAT2 marks
A 5-stage instruction pipeline has stage delays of 180, 250, 150, 170, and 250, respectively, in nanoseconds. The delay of an inter-stage latch is 10 nanoseconds. Assume that there are no pipeline stalls due to branches and other hazards. The time taken to process 1000 instructions in microseconds is __________ . (rounded off to two decimal places)
Show answer without attempting

Answer: 260.20 to 261.20

Q57

Storage and IndexingNAT2 marks
In a B+B^+- tree where each node can hold at most four key values, a root to leaf path consists of the following nodes:

A = (49, 77, 83, -), B = (7, 19, 33, 44), C = (20∗,22∗,25∗,26∗20^*, 22^*, 25^*, 26^*)

The *-marked keys signify that these are data entries in a leaf.

Assume that a pointer between keys k1k_1 and k2k_2 points to a subtree containing keys in [k1,k2)[k_1, k_2), and that when a leaf is created, the smallest key in it is copied up into its parent.

A record with key value 23 is inserted into the B+B^+- tree.

The smallest key value in the parent of the leaf that contains 25∗25^* is __________ . (Answer in integer)
Show answer without attempting

Answer: 33

Q58

Memory ManagementNAT2 marks
A computer system supports a logical address space of 2322^{32} bytes. It uses two-level hierarchical paging with a page size of 4096 bytes. A logical address is divided into a bb-bit index to the outer page table, an offset within the page of the inner page table, and an offset within the desired page. Each entry of the inner page table uses eight bytes. All the pages in the system have the same size.

The value of bb is ___________ . (Answer in integer)
Show answer without attempting

Answer: 11

Q59

Graph AlgorithmsNAT2 marks
Consider the following algorithm someAlgo that takes an undirected graph GG as input.

someAlgo(GG)
1. Let vv be any vertex in GG. Run BFS on GG starting at vv. Let uu be a vertex in GG at maximum distance from vv as given by the BFS.
2. Run BFS on GG again with uu as the starting vertex. Let zz be the vertex at maximum distance from uu as given by the BFS.
3. Output the distance between uu and zz in GG.

The output of someAlgo(TT) for the tree shown in the given figure is ___________. (Answer in integer)
Question figure
Show answer without attempting

Answer: 6

Q60

Regular LanguagesNAT2 marks
Let Σ={1,2,3,4}\Sigma = \{1,2,3,4\}. For x∈Σ∗x \in \Sigma^*, let prod(x)prod(x) be the product of symbols in xx modulo 7. We take prod(ϵ)=1prod(\epsilon) = 1, where ϵ\epsilon is the null string.

For example, prod(124)=(1×2×4)(mod7)=1prod(124) = (1 \times 2 \times 4) \pmod 7 = 1.

Define L={x∈Σ∗∣prod(x)=2}L = \{x \in \Sigma^* \mid prod(x) = 2\}.

The number of states in a minimum state DFA for LL is ___________. (Answer in integer)
Show answer without attempting

Answer: 6

Q61

Instruction PipeliningNAT2 marks
An application executes 6.4×1086.4 \times 10^8 number of instructions in 6.3 seconds. There are four types of instructions, the details of which are given in the table. The duration of a clock cycle in nanoseconds is _________ . (rounded off to one decimal place)
Instruction typeClock cycles required per instruction (CPI)Number of instructions executed
Branch22.25×1082.25 \times 10^8
Load51.20×1081.20 \times 10^8
Store41.65×1081.65 \times 10^8
Arithmetic31.30×1081.30 \times 10^8
Show answer without attempting

Answer: 3.0

Q62

C ProgrammingNAT2 marks
Consider the following C program:
#include <stdio.h>
int main(){
    int a;
    int arr[5] = {30,50,10};
    int *ptr;
    ptr = &arr[0] + 1;
    a = *ptr;
    (*ptr)++;
    ptr++;
    printf("%d", a + (*ptr) + arr[1]);
    return 0;
}
The output of the above program is ___________. (Answer in integer)
Show answer without attempting

Answer: 111

Q63

RecursionNAT2 marks
Consider the following C program:
#include <stdio.h>
int g(int n) {
    return (n+10);
}
int f(int n) {
    return g(n*2);
}
int main() {
    int sum, n;
    sum=0;
    for (n=1; n<3; n++)
        sum += g(f(n));
    printf ("%d", sum);
    return 0;
}
The output of the given C program is ________. (Answer in integer)
Show answer without attempting

Answer: 46

Q64

Probability and StatisticsNAT2 marks
A quadratic polynomial (x−α)(x−β)(x - \alpha)(x - \beta) over complex numbers is said to be square invariant if (x−α)(x−β)=(x−α2)(x−β2)(x - \alpha)(x - \beta) = (x - \alpha^2)(x - \beta^2). Suppose from the set of all square invariant quadratic polynomials we choose one at random.

The probability that the roots of the chosen polynomial are equal is __________ . (rounded off to one decimal place)
Show answer without attempting

Answer: 0.5

Q65

Probability and StatisticsNAT2 marks
The unit interval (0,1)(0,1) is divided at a point chosen uniformly distributed over (0,1)(0,1) in R\mathbb{R} into two disjoint subintervals.

The expected length of the subinterval that contains 0.4 is ___________. (rounded off to two decimal places)
Show answer without attempting

Answer: 0.70 to 0.80

0/650 correct0 marks

More GATE CS papers