GATE CSE 2021 Set 2 Question Paper with Solutions & Answer Key
All 55 questions of the GATE CSE 2021 Set 2 paper (85 marks: 25 one-mark and 30 two-mark; 24 MCQ, 13 MSQ, 18 NAT), with the answer key and a verified solution for each. See more GATE CSE question papers or all GATE CSE PYQs.
- Questions
- 55
- Total marks
- 85
- MCQ / MSQ / NAT
- 24 / 13 / 18
- Topics
- 42
GATE CSE 2021 Set 2 paper analysis
Engineering Mathematics and Theory of Computation together made up 24 of 85 marks, up 2 from GATE CSE 2020. 18 of 55 questions were NAT, the most since 2020. Probability and Statistics was the heaviest single topic with 5 marks across 3 questions. Compiler Design moved the most against GATE CSE 2020: up 4 marks.
All GATE CSE 2021 Set 2 questions
Each question opens its full verified solution.
- Q1 · MCQ · 1 mark · Minimum Spanning TreesLet G be a connected undirected weighted graph. Consider the following two statements. S1 : There exists a minimum weight edge in G which is present in every minimum spa…
- Q2 · MCQ · 1 mark · Binary HeapsLet H be a binary min-heap consisting of n elements implemented as an array. What is the worst case time complexity of an optimal algorithm to find the maximum element i…
- Q3 · MCQ · 1 mark · Lexical Analysis, Parsing and SDTConsider the following ANSI C program: int main() { Integer x; return 0; } Which one of the following phases in a seven-phase C compiler will throw an error?
- Q4 · MCQ · 1 mark · Number Representation and ArithmeticThe format of the single-precision floating-point representation of a real number as per the IEEE 754 standard is as follows: Which one of the following choices is corre…
- Q5 · MCQ · 1 mark · Combinational and Sequential CircuitsWhich one of the following circuits implements the Boolean function given below? f(x, y, z) = m0 + m1 + m3 + m4 + m5 + m6, where mi is the ith minterm.
- Q6 · MCQ · 1 mark · Integrity Constraints and Normal FormsConsider the following statements S1 and S2 about the relational data model: S1: A relation scheme can have at most one foreign key. S2: A foreign key in a relation sche…
- Q7 · MCQ · 1 mark · TCP Flow and Congestion ControlConsider the three-way handshake mechanism followed during TCP connection establishment between hosts P and Q. Let X and Y be two random 32-bit starting sequence numbers…
- Q8 · MCQ · 1 mark · Searching, Sorting and HashingWhat is the worst-case number of arithmetic operations performed by recursive binary search on a sorted array of size n?
- Q9 · MCQ · 1 mark · Regular Expressions and Finite AutomataLet L ⊆ {0, 1}* be an arbitrary regular language accepted by a minimal DFA with k states. Which one of the following languages must necessarily be accepted by a minimal…
- Q10 · MCQ · 1 mark · Programming in CConsider the following ANSI C program. #include int main(){ int arr[4][5]; int i, j; for (i=0; i What is the output of the above program?
- Q11 · MSQ · 1 mark · Sets, Relations and FunctionsConsider the following sets, where n ≥ 2: S1: Set of all n × n matrices with entries from the set {a, b, c} S2: Set of all functions from the set {0, 1, 2, , n2 - 1} to…
- Q12 · MSQ · 1 mark · Regular and Context-Free LanguagesLet L1 be a regular language and L2 be a context-free language. Which of the following languages is/are context-free?
- Q13 · MSQ · 1 mark · Intermediate Code GenerationIn the context of compilers, which of the following is/are NOT an intermediate representation of the source program?
- Q14 · MSQ · 1 mark · CPU and I/O SchedulingWhich of the following statement(s) is/are correct in the context of CPU scheduling?
- Q15 · MSQ · 1 mark · Propositional and First-Order LogicChoose the correct choice(s) regarding the following propositional logic assertion S: S : ((P Q) → R) → ((P Q) → (Q → R))
- Q16 · NAT · 1 mark · TreesConsider a complete binary tree with 7 nodes. Let A denote the set of first 3 elements obtained by performing Breadth-First Search (BFS) starting from the root. Let B de…
- Q17 · NAT · 1 mark · Regular Expressions and Finite AutomataConsider the following deterministic finite automaton (DFA). The number of strings of length 8 accepted by the above automaton is …
- Q18 · NAT · 1 mark · Number Representation and ArithmeticIf x and y are two decimal digits and (0.1101)2 = (0.8xy5)10, the decimal value of x + y is …
- Q19 · NAT · 1 mark · Cache Memory and HierarchyConsider a set-associative cache of size 2KB (1KB = 210 bytes) with cache block size of 64 bytes. Assume that the cache is byte-addressable and a 32-bit address is used…
- Q20 · NAT · 1 mark · I/O Interface, Interrupts and DMAConsider a computer system with DMA support. The DMA module is transferring one 8-bit character in one CPU cycle from a device to memory through cycle stealing at regula…
- Q21 · NAT · 1 mark · File Organization and IndexingA data file consisting of 1,50,000 student-records is stored on a hard disk with block size of 4096 bytes. The data file is sorted on the primary key RollNo. The size of…
- Q22 · NAT · 1 mark · Probability and StatisticsFor a given biased coin, the probability that the outcome of a toss is a head is 0.4. This coin is tossed 1,000 times. Let X denote the random variable whose value is th…
- Q23 · NAT · 1 mark · Programming in CConsider the following ANSI C function: int SomeFunction(int x, int y) { if ((x == 1) || (y == 1)) return 1; if (x == y) return x; if (x > y) return SomeFunction(x - y,…
- Q24 · NAT · 1 mark · Linear AlgebraSuppose that P is a 4 × 5 matrix such that every solution of the equation Px = 0 is a scalar multiple of [2 5 4 3 1]T. The rank of P is …
- Q25 · NAT · 1 mark · CalculusSuppose that f R → R is a continuous function on the interval [-3, 3] and a differentiable function in the interval (-3, 3) such that for every x in the interval, f'(x)…
- Q26 · MCQ · 2 marks · Greedy AlgorithmsConsider the string abbccddeee . Each letter in the string must be assigned a binary code satisfying the following properties: 1. For any two letters, the code assigned…
- Q27 · MCQ · 2 marks · Cache Memory and HierarchyAssume a two-level inclusive cache hierarchy, L1 and L2, where L2 is the larger of the two. Consider the following statements. S1 : Read misses in a write through L1 cac…
- Q28 · MCQ · 2 marks · Combinational and Sequential CircuitsSuppose we want to design a synchronous circuit that processes a string of 0's and 1's. Given a string, it produces another string by replacing the first 1 in any subseq…
- Q29 · MCQ · 2 marks · Probability and StatisticsIn an examination, a student can choose the order in which two questions (QuesA and QuesB) must be attempted. - If the first question is answered wrong, the student gets…
- Q30 · MCQ · 2 marks · Local OptimisationConsider the following ANSI C code segment: z = x + 3 + y->f1 + y->f2; for (i = 0; i i) { p = p + x + 3; q = q + y->f1; } else { p = p + y->f2; q = q + x + 3; } } Assume…
- Q31 · MCQ · 2 marks · SQLThe relation scheme given below is used to store information about the employees of a company, where empId is the key and deptId indicates the department to which the em…
- Q32 · MCQ · 2 marks · Transactions and Concurrency ControlLet S be the following schedule of operations of three transactions T1, T2 and T3 in a relational database system: R2(Y), R1(X), R3(Z), R1(Y), W1(X), R2(Z), W2(Y), R3(X)…
- Q33 · MCQ · 2 marks · Probability and StatisticsA bag has r red balls and b black balls. All balls are identical except for their colours. In a trial, a ball is randomly drawn from the bag, its colour is noted and the…
- Q34 · MCQ · 2 marks · Data Link LayerConsider the cyclic redundancy check (CRC) based error detecting scheme having the generator polynomial X3 + X + 1. Suppose the message m4 m3 m2 m1 m0 = 11000 is to be t…
- Q35 · MCQ · 2 marks · Programming in CConsider the following ANSI C program: #include #include struct Node{ int value; struct Node *next;}; int main(){ struct Node *boxE, *head, *boxN; int index = 0; boxE =…
- Q36 · MCQ · 2 marks · Turing Machines and UndecidabilityConsider the following two statements about regular languages: S1: Every infinite regular language contains an undecidable language as a subset. S2: Every finite languag…
- Q37 · MCQ · 2 marks · Linear AlgebraFor two n-dimensional real vectors P and Q, the operation s(P, Q) is defined as follows: s(P, Q) = Σi=1n (P[i] · Q[i]) Let L be a set of 10-dimensional non-zero real vec…
- Q38 · MCQ · 2 marks · Data Flow AnalysesFor a statement S in a program, in the context of liveness analysis, the following sets are defined: USE(S) : the set of variables used in S IN(S) : the set of variables…
- Q39 · MCQ · 2 marks · Asymptotic AnalysisFor constants a ≥ 1 and b > 1, consider the following recurrence defined on the non-negative integers: T(n) = a · T ((n)/(b) ) + f(n) Which one of the following options…
- Q40 · MSQ · 2 marks · Integrity Constraints and Normal FormsSuppose the following functional dependencies hold on a relation U with attributes P, Q, R, S, and T: P &→ QR RS &→ T Which of the following functional dependencies can…
- Q41 · MSQ · 2 marks · Regular and Context-Free LanguagesFor a string w, we define wR to be the reverse of w. For example, if w = 01101 then wR = 10110. Which of the following languages is/are context-free?
- Q42 · MSQ · 2 marks · Concurrency and SynchronizationConsider the following multi-threaded code segment (in a mix of C and pseudo-code), invoked by two processes P1 and P2, and each of the processes spawns two threads T1 a…
- Q43 · MSQ · 2 marks · DeadlockConsider a computer system with multiple shared resource types, with one instance per resource type. Each instance can be owned by only one process at a time. Owning and…
- Q44 · MSQ · 2 marks · Instruction Set and Addressing ModesIf the numerical value of a 2-byte unsigned integer on a little endian computer is 255 more than that on a big endian computer, which of the following choices represent(…
- Q45 · MSQ · 2 marks · Distance Vector and Link-State RoutingConsider a computer network using the distance vector routing algorithm in its network layer. The partial topology of the network is as shown below. The objective is to…
- Q46 · MSQ · 2 marks · Graph TraversalsConsider the following directed graph: Which of the following is/are correct about the graph?
- Q47 · MSQ · 2 marks · Regular Expressions and Finite AutomataWhich of the following regular expressions represent(s) the set of all binary numbers that are divisible by three? Assume that the string is divisible by three.
- Q48 · NAT · 2 marks · Memory Management and Virtual MemoryConsider a three-level page table to translate a 39-bit virtual address to a physical address as shown below. The page size is 4KB (1KB = 210 bytes) and page table entry…
- Q49 · NAT · 2 marks · RecursionConsider the following ANSI C program. #include int foo(int x, int y, int q) { if ((x The output of the program upon execution is …
- Q50 · NAT · 2 marks · Discrete MathematicsLet S be a set consisting of 10 elements. The number of tuples of the form (A, B) such that A and B are subsets of S, and A ⊆ B is …
- Q51 · NAT · 2 marks · ParsingConsider the following augmented grammar with {\#, @, , , a, b, c} as the set of terminals. S' → S S → S\#cS S → SS S → S@ S → S S → a S → b S → c Let I0 = CLOSURE({S' →…
- Q52 · NAT · 2 marks · Boolean Algebra and MinimizationConsider a Boolean function f(w, x, y, z) such that f(w, 0, 0, z) = 1 f(1, x, 1, z) = x + z f(w, 1, y, z) = wz + y The number of literals in the minimal sum-of-products…
- Q53 · NAT · 2 marks · Instruction PipeliningConsider a pipelined processor with 5 stages, Instruction Fetch (IF), Instruction Decode (ID), Execute (EX), Memory Access (MEM), and Write Back (WB). Each stage of the…
- Q54 · NAT · 2 marks · Data Link LayerConsider a network using the pure ALOHA medium access control protocol, where each frame is of length 1,000 bits. The channel transmission rate is 1 Mbps (= 106 bits per…
- Q55 · NAT · 2 marks · Graph TheoryIn a directed acyclic graph with a source vertex s, the *quality-score* of a directed path is defined to be the product of the weights of the edges on the path. Further,…
GATE CSE 2021 Set 2 answer key
Official answers. Open a question for the full solution.
| Q | Type | Marks | Answer | Topic |
|---|---|---|---|---|
| Q1 | MCQ | 1 | C | Minimum Spanning Trees |
| Q2 | MCQ | 1 | C | Binary Heaps |
| Q3 | MCQ | 1 | C | Lexical Analysis, Parsing and SDT |
| Q4 | MCQ | 1 | C | Number Representation and Arithmetic |
| Q5 | MCQ | 1 | A | Combinational and Sequential Circuits |
| Q6 | MCQ | 1 | D | Integrity Constraints and Normal Forms |
| Q7 | MCQ | 1 | C | TCP Flow and Congestion Control |
| Q8 | MCQ | 1 | B | Searching, Sorting and Hashing |
| Q9 | MCQ | 1 | C | Regular Expressions and Finite Automata |
| Q10 | MCQ | 1 | C | Programming in C |
| Q11 | MSQ | 1 | B, C | Sets, Relations and Functions |
| Q12 | MSQ | 1 | B, C, D | Regular and Context-Free Languages |
| Q13 | MSQ | 1 | D | Intermediate Code Generation |
| Q14 | MSQ | 1 | A, C, D | CPU and I/O Scheduling |
| Q15 | MSQ | 1 | B, D | Propositional and First-Order Logic |
| Q16 | NAT | 1 | 1 | Trees |
| Q17 | NAT | 1 | 256 | Regular Expressions and Finite Automata |
| Q18 | NAT | 1 | 3 | Number Representation and Arithmetic |
| Q19 | NAT | 1 | 2 | Cache Memory and Hierarchy |
| Q20 | NAT | 1 | 80000 | I/O Interface, Interrupts and DMA |
| Q21 | NAT | 1 | 698 | File Organization and Indexing |
| Q22 | NAT | 1 | 15.49 | Probability and Statistics |
| Q23 | NAT | 1 | 15 | Programming in C |
| Q24 | NAT | 1 | 4 | Linear Algebra |
| Q25 | NAT | 1 | 19 | Calculus |
| Q26 | MCQ | 2 | B | Greedy Algorithms |
| Q27 | MCQ | 2 | A | Cache Memory and Hierarchy |
| Q28 | MCQ | 2 | B | Combinational and Sequential Circuits |
| Q29 | MCQ | 2 | D | Probability and Statistics |
| Q30 | MCQ | 2 | D | Local Optimisation |
| Q31 | MCQ | 2 | B | SQL |
| Q32 | MCQ | 2 | B | Transactions and Concurrency Control |
| Q33 | MCQ | 2 | A | Probability and Statistics |
| Q34 | MCQ | 2 | C | Data Link Layer |
| Q35 | MCQ | 2 | D | Programming in C |
| Q36 | MCQ | 2 | C | Turing Machines and Undecidability |
| Q37 | MCQ | 2 | B | Linear Algebra |
| Q38 | MCQ | 2 | A | Data Flow Analyses |
| Q39 | MCQ | 2 | C | Asymptotic Analysis |
| Q40 | MSQ | 2 | A, C, D | Integrity Constraints and Normal Forms |
| Q41 | MSQ | 2 | B, C, D | Regular and Context-Free Languages |
| Q42 | MSQ | 2 | A, D | Concurrency and Synchronization |
| Q43 | MSQ | 2 | A, B, C | Deadlock |
| Q44 | MSQ | 2 | A, D | Instruction Set and Addressing Modes |
| Q45 | MSQ | 2 | B, C | Distance Vector and Link-State Routing |
| Q46 | MSQ | 2 | A, B | Graph Traversals |
| Q47 | MSQ | 2 | A, B, C | Regular Expressions and Finite Automata |
| Q48 | NAT | 2 | 4108 | Memory Management and Virtual Memory |
| Q49 | NAT | 2 | 60 | Recursion |
| Q50 | NAT | 2 | 59049 | Discrete Mathematics |
| Q51 | NAT | 2 | 8 | Parsing |
| Q52 | NAT | 2 | 6 | Boolean Algebra and Minimization |
| Q53 | NAT | 2 | 1.88 | Instruction Pipelining |
| Q54 | NAT | 2 | 135 | Data Link Layer |
| Q55 | NAT | 2 | 929 | Graph Theory |
Subject-wise weightage
Where the marks came from in GATE CSE 2021 Set 2, against GATE CSE 2020 and the average paper.
| Subject | Qs | Marks | Share | vs previous year | Avg marks / paper |
|---|---|---|---|---|---|
| GATE CSE Engineering Mathematics PYQs | 10 | 15 | 18% | +2 | 14.8 |
| GATE CSE Theory of Computation PYQs | 6 | 9 | 11% | 0 | 6.9 |
| GATE CSE Algorithms PYQs | 5 | 8 | 9% | -1 | 7.2 |
| GATE CSE Programming and Data Structures PYQs | 6 | 8 | 9% | -3 | 9.5 |
| GATE CSE Compiler Design PYQs | 5 | 8 | 9% | +4 | 5.2 |
| GATE CSE Databases PYQs | 5 | 8 | 9% | 0 | 6.8 |
| GATE CSE Computer Organization and Architecture PYQs | 5 | 8 | 9% | -2 | 6.8 |
| GATE CSE Digital Logic PYQs | 5 | 7 | 8% | +3 | 5.5 |
| GATE CSE Computer Networks PYQs | 4 | 7 | 8% | +3 | 7.6 |
| GATE CSE Operating Systems PYQs | 4 | 7 | 8% | -3 | 7.4 |
GATE CSE 2021 Set 2 FAQ
- How many questions were in GATE CSE 2021 Set 2?
- GATE CSE 2021 Set 2 had 55 questions for 85 marks: 24 MCQ, 13 MSQ and 18 NAT.
- Which subject carried the most marks in GATE CSE 2021 Set 2?
- Engineering Mathematics carried the most marks (15 of 85). The top three were Engineering Mathematics (15), Theory of Computation (9), Algorithms (8).
- Where can I find the GATE CSE 2021 Set 2 answer key?
- The answer key table on this page lists the answer to every question of GATE CSE 2021 Set 2. Open any question for its full verified solution.
- Is the GATE CSE 2021 Set 2 paper useful for GATE 2027 preparation?
- Yes. Solving past GATE CSE papers shows how marks are spread across subjects and which topics repeat. Compare it with other GATE CSE question papers and the topic-wise GATE CSE PYQs.