Gate 2021 Cs Engineering Quesitons 431737642736402
Gate 2021 Cs Engineering Quesitons 431737642736402
com
1
byjusexamprep.com
SECTION: GENERAL APTITUDE
1 3
C. D.
2 2
5. The number of students in three classes is in the exercise performance and reduces discomfort.
ratio 3:13:6. If 18 students are added to each class, Scientists researched whether listening to music
the ratio changes to 15:35:21. while studying can help students learn better and
The total number of students in all the three classes the results were inconclusive. Students who needed
in the beginning was: external stimulation for studying fared worse while
2
byjusexamprep.com
10.
400
296 300
300 240
200 210
200
100
100
0
Year 1 Year2 Year 3
A jigsaw puzzle has 2 pieces. One of the pieces is
Number of units
shown above. Which one of the given options for the
missing piece when assembled will form a The number of units of a product sold in three
rectangle? The piece can be moved, rotated or different years and the respective net profits are
flipped to assemble with the above piece. presented in the figure above. The cost/unit in Year
3 was ₹ 1, which was half the cost/unit in Year 2.
The cost/unit in Year 3 was one-third of the cost/unit
in Year 1. Taxes were paid on the selling price at
A. 10%, 13% and 15% respectively for the three
years. Net profit is calculated as the difference
between the selling price and the sum of cost and
taxes paid in that year.
The ratio of the selling price in Year 2 to the selling
price in Year 3 is _______ .
B.
A. 4 : 3 B. 1 : 1
C. 1 : 2 D. 3 : 4
3
byjusexamprep.com
TECHNICAL
4
byjusexamprep.com
5
byjusexamprep.com
A. f(n) is (
O nlogb ( a )− ) for some ∈> 0, then T(n) is Which of the following functional dependencies can
be inferred from the above functional
n( log b ( a )
). dependencies?
A. PS → T B. PS → Q
n
B. If f(n) is , then T(n) is ( log 2 (n) ) . C. P → R D. R → T
log 2 (n)
19. Consider the cyclic redundancy check (CRC) based
C. If f(n) is n ( log b ( a )
) , then T(n) is ( n log b ( a )
). error detecting scheme having the generator
polynomial X3 + X + 1. Suppose the message
D. If f(n) is n log2(n), then T(n) is ( n log 2 (n) ) . m4m3m2m1m0 = 11000 is to be transmitted. Check
bits c2c1c0 are appended at the end of the message
15. Choose the correct choice(s) regarding the following by the transmitter using the above CRC scheme. The
D. The antecedent of S is logically equivalent to the 20. If x and y are two decimal digits and (0.1101)2 =
16. Consider a computer system with DMA support. The 21. Consider a complete binary tree with 7 nodes. Let A
DMA module is transferring one 8-bit character in denote the set of first 3 elements obtained by
one CPU cycle from a device to memory through performing Breadth-First Search (BFS) starting from
cycle stealing at regular intervals. Consider a 2 MHZ the root. Let B denote the set of first 3 elements
processor. If 0.5% processor cycles are used for obtained by performing Depth-First Search (DFS)
DMA, the data transfer rate of the device is _______ starting from the root.
17. Consider the following augmented grammar with 22. Let L1 be a regular language and L2 be a context-
{#, @, <, >, a, b, c} as the set of terminals. free language. Which of the following languages
S′ → S is/are context-free?
S →S#cS (
A. L1 L 2 L 2 )
S → SS
S → S@ B. L1 L 2
S →< S >
( ) (
C. L1 L 2 L1 L 2 )
S→a
S→b D. L1 L 2
6
byjusexamprep.com
Which one of the following phases in a seven-phase 28. Consider a three-level page table to translate a 39-
C compiler will throw an error? bit virtual address to a physical address as shown
A. Lexical analyzer below.
B. Machine dependent optimizer
C. Semantic analyzer
D. Syntax analyzer
24. Consider the following two statements about regular
languages:
S1: Every infinite regular language contains an The page size is 4K8 (1KB = 210 bytes) and page
undecidable language as a subset. table entry size at every level is 8 bytes. A process
S2: Every finite language is regular. P is currently using 2GB (1GB = 2 30 bytes) virtual
Which one of the following choices is correct? memory which is mapped to 2GB of physical
A. Only S2 is true. B. Both S1 and S2 are true. memory. The minimum amount of memory required
C. Neither S1 nor S2 is true. D. for the page table of P across all levels is _______
Only S1 is true. KB.
25. Suppose that f : R → R is a continuous function on 29. Consider the three-way handshake mechanism
the interval [-3, 3] and a differentiable function in followed during TCP connection establishment
the interval (-3, 3) such that for every x in the between hosts P and Q. Let X and Y be two random
interval, f′(x) ≤ 2. If f(-3) = 7, then f(3) is at most 32-bit starting sequence numbers chosen by P and
________ . Q respectively. Suppose P sends a TCP connection
26. Consider the following statements S1 and S2 about request message to Q with a TCP segment having
the relational data model: SYN bit = 1, SEQ number = X, and ACK bit = 0.
S1: A relation scheme can have at most one foreign Suppose Q accepts the connection request. Which
key. one of the following choices represents the
S2: A foreign key in a relation scheme R cannot be information present in the TCP segment header that
used to refer to tuples of R. is sent by Q to P?
Which one of the following choices is correct? A. SYN bit = 1, SEQ number = Y, ACK bit = 1, ACK
A. S1 is false and S2 is true. number = X+1, FIN bit = 0
B. S1 is true and S2 is false. B. SYN bit = 0, SEQ number = X+1, ACK bit = 0,
C. Both S1 and S2 are false. ACK number = Y, FIN bit = 1
D. Both S1 and S2 are true. C. SYN bit = 1, SEQ number = X+1, ACK bit = 0,
27. For a string w, we define wR to be reverse of w. For ACK number = Y, FIN bit = 0
example, if w = 01101 then wR = 10110. Which of D. SYN bit = 1, SEQ number = Y, ACK bit = 1, ACK
the following languages is/are context-free? number = X, FIN bit = 0
A. {wwRxxR | w, x ∈ {0, 1}*} 30. Consider a computer network using the distance
B. {wxwRxR | w, x ∈ {0, 1}*} vector routing algorithm in its network layer. The
C. {wxwR | w, x ∈ {0, 1}*} partial topology of the network is as shown below.
D. {wxxRwR | w, x ∈ {0, 1}*}
7
byjusexamprep.com
8
byjusexamprep.com
A. Θ(n2) B. Θ( n )
C. Θ(n) D. Θ(log2(n))
9
byjusexamprep.com
EX stage, takes one cycle. Assume that the ID stage holding a global lock (L). The following scheme is
merely decodes the instruction and the register read used to own a resource instance :
is performed in the EX stage. The EX stage takes function OWNRESOURCE(Resource R)
one cycle for ADD instruction and two cycles for MUL Acquire lock L // a global lock
instruction. Ignore pipeline register latencies. if R is available then
Consider the following sequence of 8 instructions: Acquire R
ADD, MUL, ADD, MUL, ADD, MUL, ADD, MUL Release lock L
Assume that every MUL instruction is data- else
dependent on the ADD instruction just before it and if R is owned by another process P then
every ADD instruction (except the first ADD) is data- Terminate P, after releasing all resources
dependent on the MUL instruction just before it. The owned by P
Speedup is defined as follows: Acquire R
Execution time without operand forwarding Restart P
Speedup =
Execution time with operand forwarding
Release lock L
The Speedup achieved in executing the given end if
instruction sequence on the pipelined processor end if
(rounded to 2 decimal places) is ________. end if
42. Assume a two-level inclusive cache hierarchy, L1 end function
and L2, where L2 is the larger of the two. Consider Which of the following choice(s) about the above
the following statements. scheme is/are correct?
S1 : Read misses in a write through L1 cache do not A. The scheme violates the mutual exclusion
result in writebacks of dirty lines to the L2. property.
S2 : Write allocate policy must be used in B. The scheme ensures that deadlocks will not
conjunction with write through caches and no-write occur.
allocate policy is used with writeback caches. C. The scheme may lead to starvation.
Which of the following statements is correct? D. The scheme may lead to live-lock.
A. S1 is true and S2 is false 45. Consider the following ANSI C program:
B. S1 is false and S2 is false #include <stdio.h>
C. S1 is false and S2 is true #include <stdlib.h>
D. S1 is true and S2 is true struct Node{
43. Which of the following regular expressions int value;
represent(s) the set of all binary numbers that are struct Node *next;};
divisible by three? Assume that the string ϵ is int main(){
divisible by three. struct Node *boxE, *head, *boxN; int index = 0;
A. (0*(1(01*0)*1)*)* boxE = head = (struct Node *) malloc(sizeof(struct
B. (0 + 1(01*0)*1)* Node));
C. (0 + 11 + 11(1 + 00)*00)* head->value = index;
D. (0 + 11 + 10(1 + 00)*01)* for (index = 1; index <= 3; index++){
44. Consider a computer system with multiple shared boxN = (struct Node *) malloc(sizeof(struct Node));
resource types, with one instance per resource type. boxE->next = boxN;
Each instance can be owned by only one process at boxN->va1ue = index;
a time. Owning and freeing of resources are done by
10
byjusexamprep.com
11
byjusexamprep.com
12
byjusexamprep.com
C. D.
****
13
COMPUTER ORGANIZATION & ARCHITECTURE DMA AND I/O INTERFACE
14