Subjects in this paper

GATE CS 2022 CS questions

Q1

Verbal AptitudeMCQ1 mark−1/3 if wrong
The _________ is too high for it to be considered _________.
Show answer without attempting

Answer: D

Q2

Quantitative AptitudeMCQ1 mark−1/3 if wrong
A function y(x)y(x) is defined in the interval [0,1][0, 1] on the xx-axis as

y(x)={2if 0≤x<133if 13≤x<341if 34≤x≤1y(x) = \begin{cases} 2 & \text{if } 0 \le x < \frac{1}{3} \\ 3 & \text{if } \frac{1}{3} \le x < \frac{3}{4} \\ 1 & \text{if } \frac{3}{4} \le x \le 1 \end{cases}

Which one of the following is the area under the curve for the interval [0,1][0, 1] on the xx-axis?
Show answer without attempting

Answer: C

Q3

Quantitative AptitudeMCQ1 mark−1/3 if wrong
Let rr be a root of the equation x2+2x+6=0x^2 + 2x + 6 = 0.

Then the value of the expression (r+2)(r+3)(r+4)(r+5)(r + 2)(r + 3)(r + 4)(r + 5) is
Show answer without attempting

Answer: D

Q4

Analytical AptitudeMCQ1 mark−1/3 if wrong
Given below are four statements.

Statement 1: All students are inquisitive.
Statement 2: Some students are inquisitive.
Statement 3: No student is inquisitive.
Statement 4: Some students are not inquisitive.

From the given four statements, find the two statements that CANNOT BE TRUE simultaneously, assuming that there is at least one student in the class.
Show answer without attempting

Answer: A

Q5

Spatial AptitudeMCQ1 mark−1/3 if wrong
A palindrome is a word that reads the same forwards and backwards. In a game of words, a player has the following two plates painted with letters.

From the additional plates given in the options, which one of the combinations of additional plates would allow the player to construct a five-letter palindrome. The player should use all the five plates exactly once. The plates can be rotated in their plane.
Question figure
Show answer without attempting

Answer: B

Q6

Analytical AptitudeMCQ2 marks−2/3 if wrong
Some people believe that “what gets measured, improves”. Some others believe that “what gets measured, gets gamed”. One possible reason for the difference in the beliefs is the work culture in organizations. In organizations with good work culture, metrics help improve outcomes. However, the same metrics are counterproductive in organizations with poor work culture.

Which one of the following is the CORRECT logical inference based on the information in the above passage?
Show answer without attempting

Answer: B

Q7

Quantitative AptitudeMCQ2 marks−2/3 if wrong
In a recently conducted national entrance test, boys constituted 65% of those who appeared for the test. Girls constituted the remaining candidates and they accounted for 60% of the qualified candidates.

Which one of the following is the correct logical inference based on the information provided in the above passage?
Show answer without attempting

Answer: D

Q8

Quantitative AptitudeMCQ2 marks−2/3 if wrong
A box contains five balls of same size and shape. Three of them are green coloured balls and two of them are orange coloured balls. Balls are drawn from the box one at a time. If a green ball is drawn, it is not replaced. If an orange ball is drawn, it is replaced with another orange ball.

First ball is drawn. What is the probability of getting an orange ball in the next draw?
Show answer without attempting

Answer: D

Q9

Spatial AptitudeMCQ2 marks−2/3 if wrong
The corners and mid-points of the sides of a triangle are named using the distinct letters P, Q, R, S, T and U, but not necessarily in the same order. Consider the following statements:

* The line joining P and R is parallel to the line joining Q and S.
* P is placed on the side opposite to the corner T.
* S and U cannot be placed on the same side.

Which one of the following statements is correct based on the above information?
Show answer without attempting

Answer: B

Q10

Quantitative AptitudeMCQ2 marks−2/3 if wrong
A plot of land must be divided between four families. They want their individual plots to be similar in shape, not necessarily equal in area. The land has equally spaced poles, marked as dots in the below figure. Two ropes, R1 and R2, are already present and cannot be moved.

What is the least number of additional straight ropes needed to create the desired plots? A single rope can pass through three poles that are aligned in a straight line.
Question figure
Show answer without attempting

Answer: D

Q11

Algorithm AnalysisMCQ1 mark−1/3 if wrong
Which one of the following statements is TRUE for all positive functions f(n)f(n)?
Show answer without attempting

Answer: A

Q12

Regular LanguagesMCQ1 mark−1/3 if wrong
Which one of the following regular expressions correctly represents the language of the finite automaton given below?
Question figure
Show answer without attempting

Answer: D

Q13

ParsingMCQ1 mark−1/3 if wrong
Which one of the following statements is TRUE?
Show answer without attempting

Answer: D

Q14

Relational DesignMCQ1 mark−1/3 if wrong
In a relational data model, which one of the following statements is TRUE?
Show answer without attempting

Answer: A

Q15

Linear Data StructuresMCQ1 mark−1/3 if wrong
Consider the problem of reversing a singly linked list. To take an example, given the linked list below,

head -> [a] -> [b] -> [c] -> [d] -> [e] -> NULL

the reversed linked list should look like

head -> [e] -> [d] -> [c] -> [b] -> [a] -> NULL

Which one of the following statements is TRUE about the time complexity of algorithms that solve the above problem in O(1)O(1) space?
Show answer without attempting

Answer: A

Q16

Searching Sorting and HashingMCQ1 mark−1/3 if wrong
Suppose we are given nn keys, mm hash table slots, and two simple uniform hash functions h1h_1 and h2h_2. Further suppose our hashing scheme uses h1h_1 for the odd keys and h2h_2 for the even keys. What is the expected number of keys in a slot?
Show answer without attempting

Answer: B

Q17

Input OutputMCQ1 mark−1/3 if wrong
Which one of the following facilitates transfer of bulk data from hard disk to main memory with the highest throughput?
Show answer without attempting

Answer: A

Q18

Number Representation and ArithmeticMCQ1 mark−1/3 if wrong
Let R1R1 and R2R2 be two 4-bit registers that store numbers in 2's complement form. For the operation R1+R2R1+R2, which one of the following values of R1R1 and R2R2 gives an arithmetic overflow?
Show answer without attempting

Answer: B

Q19

Concurrency and SynchronizationMCQ1 mark−1/3 if wrong
Consider the following threads, T1T_1, T2T_2, and T3T_3 executing on a single processor, synchronized using three binary semaphore variables, S1S_1, S2S_2, and S3S_3, operated upon using standard wait() and signal(). The threads can be context switched in any order and at any time.
T1
while(true){
  wait(S3);
  print(“C”);
  signal(S2);
}

T2
while(true){
  wait(S1);
  print(“B”);
  signal(S3);
}

T3
while(true){
  wait(S2);
  print(“A”);
  signal(S1);
}
Which initialization of the semaphores would print the sequence BCABCABCA....?
Show answer without attempting

Answer: C

Q20

Linear AlgebraMCQ1 mark−1/3 if wrong
Consider the following two statements with respect to the matrices Am×nA_{m \times n}, Bn×mB_{n \times m}, Cn×nC_{n \times n} and Dn×nD_{n \times n}.

Statement 1: tr(AB)=tr(BA)\text{tr}(AB) = \text{tr}(BA)
Statement 2: tr(CD)=tr(DC)\text{tr}(CD) = \text{tr}(DC)

where tr()\text{tr}() represents the trace of a matrix. Which one of the following holds?
Show answer without attempting

Answer: C

Q21

C ProgrammingMCQ1 mark−1/3 if wrong
What is printed by the following ANSI C program?
#include<stdio.h>
int main(int argc, char *argv[])
{
  int x = 1, z[2] = {10, 11};
  int *p = NULL;
  p = &x;
  *p = 10;
  p = &z[1];
  *(&z[0] + 1) += 3;
  printf("%d, %d, %d\n", x, z[0], z[1]);
  return 0;
}
Show answer without attempting

Answer: D

Q22

Layering and SwitchingMCQ1 mark−1/3 if wrong
Consider an enterprise network with two Ethernet segments, a web server and a firewall, connected via three routers as shown below.

What is the number of subnets inside the enterprise network?
Question figure
Show answer without attempting

Answer: C

Q23

ComputabilityMSQ1 mark
Which of the following statements is/are TRUE?
More than one option can be correct.
Show answer without attempting

Answer: B, C, D

Q24

Memory HierarchyMSQ1 mark
Let WB and WT be two set associative cache organizations that use LRU algorithm for cache block replacement. WB is a write back cache and WT is a write through cache. Which of the following statements is/are FALSE?
More than one option can be correct.
Show answer without attempting

Answer: A, B, D

Q25

Relational QueriesMSQ1 mark
Consider the following three relations in a relational database.

Employee(eId‾,Name),Brand(bId‾,bName),Own(eId‾,bId‾)\text{Employee}(\underline{\text{eId}}, \text{Name}), \text{Brand}(\underline{\text{bId}}, \text{bName}), \text{Own}(\underline{\text{eId}}, \underline{\text{bId}})

Which of the following relational algebra expressions return the set of eIds who own all the brands?
More than one option can be correct.
Show answer without attempting

Answer: A, B

Q26

DeadlocksMSQ1 mark
Which of the following statements is/are TRUE with respect to deadlocks?
More than one option can be correct.
Show answer without attempting

Answer: A, D

Q27

Discrete MathematicsMSQ1 mark
Which of the following statements is/are TRUE for a group GG?
More than one option can be correct.
Show answer without attempting

Answer: A, B, C

Q28

Tree Data StructuresNAT1 mark
Suppose a binary search tree with 1000 distinct elements is also a complete binary tree. The tree is stored using the array representation of binary heap trees. Assuming that the array indices start with 0, the 3rd3^{\text{rd}} largest element of the tree is stored at index_____________
Show answer without attempting

Answer: 509

Q29

ParsingNAT1 mark
Consider the augmented grammar with {+,∗,(,),id}\{+, *, (, ), \text{id}\} as the set of terminals.

S′→SS' \to S
S→S+R∣RS \to S + R \mid R
R→R∗P∣PR \to R * P \mid P
P→(S)∣idP \to (S) \mid \text{id}

If I0I_0 is the set of two LR(0)LR(0) items {[S′→S∙],[S→S∙+R]}\bigl\{[S' \to S\bullet], [S \to S\bullet + R]\bigr\}, then goto(closure(I0),+)\text{goto}(\text{closure}(I_0), +) contains exactly __________ items.
Show answer without attempting

Answer: 5

Q30

Discrete MathematicsNAT1 mark
Consider a simple undirected graph of 10 vertices. If the graph is disconnected, then the maximum number of edges it can have is ____________.
Show answer without attempting

Answer: 36

Q31

Relational DesignNAT1 mark
Consider a relation R(A,B,C,D,E)R(A, B, C, D, E) with the following three functional dependencies.

AB→CAB \to C; BC→DBC \to D; C→EC \to E;

The number of superkeys in the relation R is _____________.
Show answer without attempting

Answer: 8

Q32

Discrete MathematicsNAT1 mark
The number of arrangements of six identical balls in three identical bins is______.
Show answer without attempting

Answer: 7

Q33

Memory HierarchyNAT1 mark
A cache memory that has a hit rate of 0.8 has an access latency 10 ns and miss penalty 100 ns. An optimization is done on the cache to reduce the miss rate. However, the optimization results in an increase of cache access latency to 15 ns, whereas the miss penalty is not affected. The minimum hit rate (rounded off to two decimal places) needed after the optimization such that it should not increase the average memory access time is _____________.
Show answer without attempting

Answer: 0.85

Q34

CalculusNAT1 mark
The value of the following limit is _____________.

lim⁡x→0+x1−e2x\lim_{x \to 0^+} \frac{\sqrt{x}}{1 - e^{2\sqrt{x}}}
Show answer without attempting

Answer: -0.5

Q35

Application LayerNAT1 mark
Consider the resolution of the domain name www.gate.org.in by a DNS resolver. Assume that no resource records are cached anywhere across the DNS servers and that iterative query mechanism is used in the resolution. The number of DNS query-response pairs involved in completely resolving the domain name is_____________.
Show answer without attempting

Answer: 4

Q36

Discrete MathematicsMCQ2 marks−2/3 if wrong
Which one of the following is the closed form for the generating function of the sequence {an}n≥0\{a_n\}_{n \ge 0} defined below?

an={n+1,n is odd1,otherwisea_n = \begin{cases} n+1, & n \text{ is odd} \\ 1, & \text{otherwise} \end{cases}
Show answer without attempting

Answer: A

Q37

Discrete MathematicsMCQ2 marks−2/3 if wrong
Consider a simple undirected unweighted graph with at least three vertices. If AA is the adjacency matrix of the graph, then the number of 3-cycles in the graph is given by the trace of
Show answer without attempting

Answer: D

Q38

Memory ManagementMCQ2 marks−2/3 if wrong
Which one of the following statements is FALSE?
Show answer without attempting

Answer: C

Q39

TransactionsMCQ2 marks−2/3 if wrong
Let Ri(z)R_i(z) and Wi(z)W_i(z) denote read and write operations on a data element zz by a transaction TiT_i, respectively. Consider the schedule SS with four transactions.

S:R4(x)R2(x)R3(x)R1(y)W1(y)W2(x)W3(y)R4(y)S: R_4(x)R_2(x)R_3(x)R_1(y)W_1(y)W_2(x)W_3(y)R_4(y)

Which one of the following serial schedules is conflict equivalent to SS?
Show answer without attempting

Answer: A

Q40

Memory HierarchyMCQ2 marks−2/3 if wrong
Consider a digital display system (DDS) shown in the figure that displays the contents of register XX. A 16-bit code word is used to load a word in XX, either from SS or from RR. SS is a 1024-word memory segment and RR is a 32-word register file. Based on the value of mode bit MM, TT selects an input word to load in XX. PP and QQ interface with the corresponding bits in the code word to choose the addressed word.

Which one of the following represents the functionality of PP, QQ, and TT?
Question figure
Show answer without attempting

Answer: C

Q41

Number Representation and ArithmeticMCQ2 marks−2/3 if wrong
Consider three floating point numbers AA, BB and CC stored in registers RAR_A, RBR_B and RCR_C, respectively as per IEEE-754 single precision floating point format. The 32-bit content stored in these registers (in hexadecimal form) are as follows.

RA=0xC1400000RB=0x42100000RC=0x41400000R_A = \text{0xC1400000} \quad R_B = \text{0x42100000} \quad R_C = \text{0x41400000}

Which one of the following is FALSE?
Show answer without attempting

Answer: B

Q42

SchedulingMCQ2 marks−2/3 if wrong
Consider four processes PP, QQ, RR, and SS scheduled on a CPU as per round robin algorithm with a time quantum of 4 units. The processes arrive in the order PP, QQ, RR, SS, all at time t=0t = 0. There is exactly one context switch from SS to QQ, exactly one context switch from RR to QQ, and exactly two context switches from QQ to RR. There is no context switch from SS to PP. Switching to a ready process after the termination of another process is also considered a context switch. Which one of the following is NOT possible as CPU burst time (in time units) of these processes?
Show answer without attempting

Answer: D

Q43

C ProgrammingMCQ2 marks−2/3 if wrong
What is printed by the following ANSI C program?
#include<stdio.h>
int main(int argc, char *argv[])
{
  int a[3][3][3] =
  {{1, 2, 3, 4, 5, 6, 7, 8, 9},
   {10, 11, 12, 13, 14, 15, 16, 17, 18},
   {19, 20, 21, 22, 23, 24, 25, 26, 27}};
  int i = 0, j = 0, k = 0;
  for( i = 0; i < 3; i++ ){
    for(k = 0; k < 3; k++ )
      printf("%d ", a[i][j][k]);
    printf("\n");
  }
  return 0;
}
Show answer without attempting

Answer: A

Q44

C ProgrammingMCQ2 marks−2/3 if wrong
What is printed by the following ANSI C program?
#include<stdio.h>
int main(int argc, char *argv[]){
  char a = 'P';
  char b = 'x';
  char c = (a & b) + '*';
  char d = (a | b) - '-';
  char e = (a ^ b) + '+';
  printf("%c %c %c\n", c, d, e);
  return 0;
}
ASCII encoding for relevant characters is given below
Question figure
Show answer without attempting

Answer: A

Q45

Linear AlgebraMCQ2 marks−2/3 if wrong
Consider solving the following system of simultaneous equations using LU decomposition.

x1+x2−2x3=4x_1 + x_2 - 2x_3 = 4
x1+3x2−x3=7x_1 + 3x_2 - x_3 = 7
2x1+x2−5x3=72x_1 + x_2 - 5x_3 = 7

where LL and UU are denoted as

L=(L1100L21L220L31L32L33),U=(U11U12U130U22U2300U33)L = \begin{pmatrix} L_{11} & 0 & 0 \\ L_{21} & L_{22} & 0 \\ L_{31} & L_{32} & L_{33} \end{pmatrix}, \quad U = \begin{pmatrix} U_{11} & U_{12} & U_{13} \\ 0 & U_{22} & U_{23} \\ 0 & 0 & U_{33} \end{pmatrix}

Which one of the following is the correct combination of values for L32L_{32}, U33U_{33}, and x1x_1?
Show answer without attempting

Answer: D

Q46

ComputabilityMSQ2 marks
Which of the following is/are undecidable?
More than one option can be correct.
Show answer without attempting

Answer: A, B, C

Q47

Context Free LanguagesMSQ2 marks
Consider the following languages:

L1={anwan∣w∈{a,b}∗}L_1 = \{a^nwa^n \mid w \in \{a, b\}^*\}
L2={wxwR∣w,x∈{a,b}∗,∣w∣,∣x∣>0}L_2 = \{wxw^R \mid w, x \in \{a, b\}^*, |w|, |x| > 0\}

Note that wRw^R is the reversal of the string ww. Which of the following is/are TRUE?
More than one option can be correct.
Show answer without attempting

Answer: A, B, C

Q48

Context Free LanguagesMSQ2 marks
Consider the following languages:

L1={ww∣w∈{a,b}∗}L_1 = \{ww \mid w \in \{a, b\}^*\}
L2={anbncm∣m,n≥0}L_2 = \{a^nb^nc^m \mid m, n \ge 0\}
L3={ambncn∣m,n≥0}L_3 = \{a^mb^nc^n \mid m, n \ge 0\}

Which of the following statements is/are FALSE?
More than one option can be correct.
Show answer without attempting

Answer: B, C, D

Q49

Graph AlgorithmsMSQ2 marks
Consider a simple undirected weighted graph GG, all of whose edge weights are distinct. Which of the following statements about the minimum spanning trees of GG is/are TRUE?
More than one option can be correct.
Show answer without attempting

Answer: A, B, C

Q50

Discrete MathematicsMSQ2 marks
The following simple undirected graph is referred to as the Peterson graph.

Which of the following statements is/are TRUE?
Question figure
More than one option can be correct.
Show answer without attempting

Answer: A, B, C

Q51

Discrete MathematicsMSQ2 marks
Consider the following recurrence:

f(1)=1;f(1) = 1;
f(2n)=2f(n)−1, for n≥1;f(2n) = 2f(n) - 1, \text{ for } n \ge 1;
f(2n+1)=2f(n)+1, for n≥1.f(2n+1) = 2f(n) + 1, \text{ for } n \ge 1.

Then, which of the following statements is/are TRUE?
More than one option can be correct.
Show answer without attempting

Answer: A, B, C

Q52

Discrete MathematicsMSQ2 marks
Which of the properties hold for the adjacency matrix AA of a simple undirected unweighted graph having nn vertices?
More than one option can be correct.
Show answer without attempting

Answer: A

Q53

Linear AlgebraMSQ2 marks
Which of the following is/are the eigenvector(s) for the matrix given below?

(−9−6−2−4−8−6−3−12015853221712)\begin{pmatrix} -9 & -6 & -2 & -4 \\ -8 & -6 & -3 & -1 \\ 20 & 15 & 8 & 5 \\ 32 & 21 & 7 & 12 \end{pmatrix}
More than one option can be correct.
Show answer without attempting

Answer: A, C, D

Q54

Memory HierarchyMSQ2 marks
Consider a system with 2 KB direct mapped data cache with a block size of 64 bytes. The system has a physical address space of 64 KB and a word length of 16 bits. During the execution of a program, four data words P, Q, R, and S are accessed in that order 10 times (i.e., PQRSPQRS...). Hence, there are 40 accesses to data cache altogether. Assume that the data cache is initially empty and no other data words are accessed by the program. The addresses of the first bytes of P, Q, R, and S are 0xA248, 0xC28A, 0xCA8A, and 0xA262, respectively. For the execution of the above program, which of the following statements is/are TRUE with respect to the data cache?
More than one option can be correct.
Show answer without attempting

Answer: A, B, D

Q55

IPv4MSQ2 marks
Consider routing table of an organization's router shown below:
Subnet NumberSubnet MaskNext Hop
12.20.164.0255.255.252.0R1
12.20.170.0255.255.254.0R2
12.20.168.0255.255.254.0Interface 0
12.20.166.0255.255.254.0Interface 1
defaultR3
Which of the following prefixes in CIDR notation can be collectively used to correctly aggregate all of the subnets in the routing table?
More than one option can be correct.
Show answer without attempting

Answer: B, D

Q56

Relational QueriesNAT2 marks
Consider the relational database with the following four schemas and their respective instances.

Student(sNo‾\underline{\text{sNo}}, sName, dNo) Dept(dNo‾\underline{\text{dNo}}, dName)
Course(cNo‾\underline{\text{cNo}}, cName, dNo) Register(sNo‾\underline{\text{sNo}}, cNo‾\underline{\text{cNo}})

Student
sNosNamedNo
S01JamesD01
S02RockyD01
S03JacksonD02
S04JaneD01
S05MilliD02
Dept
dNodName
D01CSE
D02EEE
Course
cNocNamedNo
C11DSD01
C12OSD01
C21DED02
C22PTD02
C23CVD03
Register
sNocNo
S01C11
S01C12
S02C11
S03C21
S03C22
S03C23
S04C11
S04C12
S05C11
S05C21
SQL Query:
SELECT * FROM Student AS S WHERE NOT EXIST
 (SELECT cNo FROM Course WHERE dNo = “D01”
 EXCEPT
 SELECT cNo FROM Register WHERE sNo = S.sNo)
The number of rows returned by the above SQL query is___________.
Show answer without attempting

Answer: 2

Q57

RoutingNAT2 marks
Consider a network with three routers P, Q, R shown in the figure below. All the links have cost of unity.

The routers exchange distance vector routing information and have converged on the routing tables, after which the link Q-R fails. Assume that P and Q send out routing updates at random times, each at the same average rate. The probability of a routing loop formation (rounded off to one decimal place) between P and Q, leading to count-to-infinity problem, is___________.
Question figure
Show answer without attempting

Answer: 0.5

Q58

Discrete MathematicsNAT2 marks
Let G(V,E)G(V, E) be a directed graph, where V={1,2,3,4,5}V = \{1, 2, 3, 4, 5\} is the set of vertices and EE is the set of directed edges, as defined by the following adjacency matrix AA.

A[i][j]={1,1≤j≤i≤50,otherwiseA[i][j] = \begin{cases} 1, & 1 \le j \le i \le 5 \\ 0, & \text{otherwise} \end{cases}

A[i][j]=1A[i][j] = 1 indicates a directed edge from node ii to node jj. A directed spanning tree of GG, rooted at r∈Vr \in V, is defined as a subgraph TT of GG such that the undirected version of TT is a tree, and TT contains a directed path from rr to every other vertex in VV. The number of such directed spanning trees rooted at vertex 5 is_____________.
Show answer without attempting

Answer: 24

Q59

Layering and SwitchingNAT2 marks
Consider a 100 Mbps link between an earth station (sender) and a satellite (receiver) at an altitude of 2100 km. The signal propagates at a speed of 3×1083 \times 10^8 m/s. The time taken (in milliseconds, rounded off to two decimal places) for the receiver to completely receive a packet of 1000 bytes transmitted by the sender is_________.
Show answer without attempting

Answer: 7.07 to 7.09

Q60

Transport LayerNAT2 marks
Consider the data transfer using TCP over a 1 Gbps link. Assuming that the maximum segment lifetime (MSL) is set to 60 seconds, the minimum number of bits required for the sequence number field of the TCP header, to prevent the sequence number space from wrapping around during the MSL is____________.
Show answer without attempting

Answer: 33

Q61

Instruction PipeliningNAT2 marks
A processor X1X_1 operating at 2 GHz has a standard 5-stage RISC instruction pipeline having a base CPI (cycles per instruction) of one without any pipeline hazards. For a given program PP that has 30% branch instructions, control hazards incur 2 cycles stall for every branch. A new version of the processor X2X_2 operating at same clock frequency has an additional branch predictor unit (BPU) that completely eliminates stalls for correctly predicted branches. There is neither any savings nor any additional stalls for wrong predictions. There are no structural hazards and data hazards for X1X_1 and X2X_2. If the BPU has a prediction accuracy of 80%, the speed up (rounded off to two decimal places) obtained by X2X_2 over X1X_1 in executing PP is____________.
Show answer without attempting

Answer: 1.42 to 1.45

Q62

Linear Data StructuresNAT2 marks
Consider the queues Q1Q_1 containing four elements and Q2Q_2 containing none (shown as the Initial State in the figure). The only operations allowed on these two queues are Enqueue(Q, element) and Dequeue(Q). The minimum number of Enqueue operations on Q1Q_1 required to place the elements of Q1Q_1 in Q2Q_2 in reverse order (shown as the Final State in the figure) without using any additional storage is___________.
Question figure
Show answer without attempting

Answer: 0

Q63

File SystemsNAT2 marks
Consider two files systems AA and BB, that use contiguous allocation and linked allocation, respectively. A file of size 100 blocks is already stored in AA and also in BB. Now, consider inserting a new block in the middle of the file (between 50th50^{\text{th}} and 51st51^{\text{st}} block), whose data is already available in the memory. Assume that there are enough free blocks at the end of the file and that the file control blocks are already in memory. Let the number of disk accesses required to insert a block in the middle of the file in AA and BB are nAn_A and nBn_B, respectively, then the value of nA+nBn_A + n_B is_________.
Show answer without attempting

Answer: 153

Q64

Memory ManagementNAT2 marks
Consider a demand paging system with four page frames (initially empty) and LRU page replacement policy. For the following page reference string

7,2,7,3,2,5,3,4,6,7,7,1,5,6,17, 2, 7, 3, 2, 5, 3, 4, 6, 7, 7, 1, 5, 6, 1

the page fault rate, defined as the ratio of number of page faults to the number of memory accesses (rounded off to one decimal place) is_________.
Show answer without attempting

Answer: 0.6

Q65

Syntax Directed TranslationNAT2 marks
Consider the following grammar along with translation rules.

S→S1#T{Sval=S1val∗Tval}S \to S_1 \# T \quad \{S_{\text{val}} = S_{1\text{val}} * T_{\text{val}}\}
S→T{Sval=Tval}S \to T \quad \{S_{\text{val}} = T_{\text{val}}\}
T→T1%R{Tval=T1val÷Rval}T \to T_1 \% R \quad \{T_{\text{val}} = T_{1\text{val}} \div R_{\text{val}}\}
T→R{Tval=Rval}T \to R \quad \{T_{\text{val}} = R_{\text{val}}\}
R→id{Rval=idval}R \to \text{id} \quad \{R_{\text{val}} = \text{id}_{\text{val}}\}

Here # and % are operators and id\text{id} is a token that represents an integer and idval\text{id}_{\text{val}} represents the corresponding integer value. The set of non-terminals is {S,T,R,P}\{S, T, R, P\} and a subscripted non-terminal indicates an instance of the non-terminal.

Using this translation scheme, the computed value of SvalS_{\text{val}} for root of the parse tree for the expression 20#10%5#8%2%220\#10\%5\#8\%2\%2 is _____________.
Show answer without attempting

Answer: 80

0/650 correct0 marks

More GATE CS papers