The GATE 2026 CS-2 question paper with solutions PDF is available here for free download. GATE 2026 Computer Science and Information Technology was conducted by IIT Guwahati on February 8, 2026, and GATE 2026 CS-2 ran in the afternoon session from 2:30 PM to 5:30 PM with 65 questions in 3 hours.
| GATE 2026 CS-2 Question Paper with Solutions | Download PDF | Check Solutions |
GATE 2026 CS-2 Questions with Solutions
Expedite, Hasten, Hurry, __________
Fill the blank by choosing a word with a meaning similar to that of the words
given above.
A black square PQRS has been cut into two parts. One part of it is shown in
Panel I. Which one of the shapes in Panel II is the other part?

A day can only be cloudy or sunny. The probability of a day being cloudy is 0.5,
independent of the condition on other days. What is the probability that in any
given four days, there will be three cloudy days and one sunny day?
The values of Stock A and Stock B on a particular day are Rs. 50 and Rs. 80,
respectively. An investor invests Rs. 100 in Stock A and Rs. 80 in Stock B. He
sells all the stocks the next day when the value of Stock A is Rs. 55 and Stock B
is Rs. 70. The profit made by the investor is Rs. ________
‘When it is raining, peacocks dance.’
Based only on this sentence, which one of the following options is necessarily
true?
Water : P :: Food : Q
Choose the P and Q combination from the options below to form a meaningful
analogy.
Two tiles are missing in Panel I. Which one of the options in Panel II is the
appropriate choice for the missing tiles?

Figures (i) and (ii) represent intercity highway systems. The black dots represent
cities and the line segments between them represent intercity highways.
A salesperson needs to make a trip. She needs to start from a city, visit each of the
remaining cities exactly once, and finally return to the same city from which she
started.
Which one of the following options is then true?

The figure in Panel I below is a grid of cells with four rows and four columns.
The numbers on the top and on the left represent the number of cells that are to
be shaded in that column and row, respectively. Which one of the options shown
in Panel II below represents the grid shaded correctly?

An unbiased six-faced dice whose faces are marked with numbers 1, 2, 3, 4, 5,
and 6 is rolled twice in succession and the number on the top face is recorded
each time. The probability that the sum of the two recorded numbers is a prime
number is ________
For two different persons ???? and ????, the predicate ????(????, ????) denotes that x knows y.
Consider the following statement.
There is a person who does not know anyone else, but that person is known by
everyone else.
Which one of the following expressions represents the above statement?
The set T represents various traversals over binary tree. The set S represents the
order of visiting nodes during a traversal.
T
S
I: Inorder
L: left subtree, node, right subtree
II: Preorder
M: node, left subtree, right subtree
III: Postorder N: left subtree, right subtree, node
Which one of the following is the correct match from T to S ?
Which one of the following statements is equivalent to the following assertion?
Turing machine ???? decides the language ????⊆{0,1}∗
The probability density function ????(????) of a random variable ???? which takes real
values is
????(????) =
1
3√2???? exp (−
????2
18), ????∈(−∞, +∞)
Which one of the following statements is correct about the random variable ???? ?
In the context of DBMS, consider the two sets T and S given below.
T
S
I: Logical schema
L: Views
II: Physical schema
M: File organization and indexes
III: External schema N: Relations
Which one of the following is the correct match from T to S ?
Which one of the following options is not a property of Boolean Algebra?
Note: + is OR operation, . is AND operation, and ′ is NOT operation
Consider the following two statements about interrupt handling mechanisms in a
CPU.
S1: In non-vectored interrupt mechanism, it usually takes more time to start the
Interrupt Service Routine (ISR) when compared to that in a vectored interrupt
mechanism.
S2: In daisy-chain interrupt mechanism, the CPU polls all the input devices
individually to determine the source of the interrupt.
Which one of the following options is correct with respect to S1 and S2 ?
Consider the following three ANSI-C programs, P1, P2, and P3.
P1
P2
P3
#include <stdio.h>
int a=5;
int main(){
int a=7;
return(0);
}
#include <stdio.h>
int main(){
int a=5;
int a=7;
return(0);
}
#include <stdio.h>
int main(){
int a=5;
float a=7;
return(0);
}
Which one of the following statements is true?
Consider concurrent execution of two transactions ????1 and ????2 in a DBMS, both of
which access a data object ????. For these two transactions to not conflict on ????, which
one of the following statements must be true?
Consider a file of size 4 million bytes being transferred between two hosts
connected via a path consisting of three consecutive links of bandwidth 2 Mbps,
500 kbps, and 1 Mbps, respectively. All processing delays and propagation delays
are negligible. Assume that there is no other background traffic over the path and
no other additional overhead to transfer the file.
Which one of the following is the total time (in seconds) to transfer the file?
Note: 1M=106, 1k=103
Which one of the following protocols may need to broadcast some of its messages?
Which one of the following CPU scheduling algorithms cannot be preemptive?
Consider the following functions, where ???? is a positive integer.
????1/3 , log(????) , log(????!), 2log(????)
Which one of the following options lists the functions in increasing order of
asymptotic growth rate?
Note: Assume the base of log to be 2.
Which of the following can be recurrence relation(s) corresponding to an algorithm
with time complexity Θ(????)?
Let ???? be a binary relation on the set {1, 2, … , 10}, where (????, ????) ∈???? if the product
of ???? and ???? is square of an integer. Which of the following properties is/are satisfied
by ?????
For a real number ????, let ????(????) = ∫(3????2 −????????+ 1) ????????
1
−1
. Which of the following
statements is/are true?
In a system, numbers are represented using 4-bit two’s complement form. Consider
four numbers ????1 =1011, ????2 =1101, ????3 =1010 and ????4 =1001 in the system.
Which of the following operations will result in arithmetic overflow?
The keys 5, 28, 19, 15, 26, 33, 12, 17, 10 are inserted into a hash table using the
hash function ℎ(????) = ???? ???????????? 9. The collisions are resolved by chaining. After all
the keys are inserted, the length of the longest chain is __________. (answer in
integer)
Consider the system of linear equations given below.
????????+ ????= ????
16????+ ????????= 24
Suppose the values of a and b are chosen such that the system of linear equations
produce multiple solutions. Then the product of a and b is __________. (answer in
integer)
Consider an array ????= [10, 7, 8, 19, 41, 35, 25, 31]. Suppose the merge sort
algorithm is executed on array ???? to sort it in increasing order. The merge sort
algorithm will carry out a total of 7 merge operations.
A merge operation on sorted left array ???? and sorted right array ???? is said to be void
if the output of the merge operation is the elements of array ???? followed by the
elements of array ????.
The number of void merge operations among these 7 merge operations
is __________. (answer in integer)
If an IP network uses a subnet mask of 255.255.240.0, the maximum number of IP
addresses that can be assigned to network interfaces is __________. (answer in
integer)
The 32-bit IEEE 754 single precision representation of a number is 0xC2710000.
The number in decimal representation is ________. (rounded off to two decimal
places)
A lexical analyzer uses the following token definitions
????????????????????????→[????−????????−????]
????????????????????→[0 −9]
????????→???????????????????????? (???????????????????????? | ????????????????????)*
????????????????????????→????????????????????+
????????→(???????????????????? | ???????????? | ????????????????????????????)+
For the string given below,
????1 23???????? 78 ???? 7???? ????????5 14???? 8???? ????????????????????
the number of tokens (excluding ????????) that will be produced by the lexical analyzer
is __________. (answer in integer)
Consider a complete graph ???????? with ???? vertices (????> 4). Note that multiple spanning
trees can be constructed over ????????. Each of these spanning trees is represented as a
set of edges. The Jaccard coefficient between any two sets is defined as the ratio of
the size of the intersection of the two sets to the size of the union of the two sets.
Which one of the following options gives the lowest possible value for the Jaccard
coefficient between any two spanning trees of ???????? ?
Let ???? be a weighted directed acyclic graph with ???? edges and ???? vertices. Given ????
and a source vertex ???? in ????, which one of the following options gives the worst case
time complexity of the fastest algorithm to find the lengths of shortest paths from ????
to all vertices that are reachable from ???? in ?????
Consider an array ???? of integers of size ????. The indices of ???? run from 1 to ????. An
algorithm is to be designed to check whether ???? satisfies the condition given below.
∀????, ????∈{1, … , ????−1} such that ????> ????, (????[????+ 1] −????[????]) > (????[????+ 1] −????[????])
Which one of the following gives the worst case time complexity of the fastest
algorithm that can be designed for the problem?
Consider a table ????, where the elements ????[????][????], 0 ≤????, ????≤????, represent the cost of
the optimal solutions of different subproblems of a problem that is being solved
using a dynamic programming algorithm. The recursive formulation to compute the
table entries is as follows:
????[0][????] = ????[????][0] = 1 for ????= 0,1,2, … , ????
????[????][????] = 2????[????−1][????] + 3????[????][????−1] for 1 ≤????, ????≤????
Consider the following two algorithms to compute entries of ????. Assume that for
both the algorithms, for all 0 ≤????, ????≤????, ????[????][????] has been initialized to 1.
Algorithm ????????, ????∈{1,2} is said to be correct if and only if it calculates the correct
values of ????[????][????], for all 0 ≤????, ????≤????, (as per the recursive formulation) at the end
of the execution of the algorithm ????????.
Which one of the following statements is true?
Consider the following 4-variable Boolean function
????(????, ????, ????, ????) = Σ????(0, 1, 2, 3, 8, 9, 10, 11)
Consider ???? as MSB, ???? as LSB. Which one of the following options represents the
minimal sum of products form for the above function?
Note: + is OR operation, . is AND operation, ′ is NOT operation
Consider the canonical ????????(0) parsing of the grammar below using terminals
{????, ????, ????} and non-terminals {????, ????, ????, ????} with ???? as the start symbol.
????→????????????
????→???????? | ????
????→???????? | ????
????→???????? | ????
Which one of the following options gives the number of shift-reduce conflicts that
will occur in the ????????(0) ACTION table?
In the context of schema normalization in relational DBMS, consider a set F of
functional dependencies. The set of all functional dependencies implied by F is
called the closure of F. To compute the closure of F, Armstrong’s Axioms can be
applied. Consider ????, ????, and ???? as sets of attributes over a relational schema. The three
rules of Armstrong’s Axioms are described as follows.
Reflexivity: If ????⊆???? , then ????→????
Augmentation: If ????→????, then ????????→???????? for any Z
Transitivity: If ????→???? and ????→????, then ????→????
The additional rule of Union is defined as follows.
Union: If ????→???? and ????→????, then ????→????????
It can be proved that the additional rule of Union is also implied by the three rules
of Armstrong’s Axioms. Listed below are four combinations of these three rules.
Which one of these combinations is both necessary and sufficient for the proof ?
Consider the transmission of data bits 110001011 over a link that uses Cyclic
Redundancy Check (CRC) code for error detection. If the generator bit pattern is
given to be 1001, which one of the following options shows the remainder bit
pattern appended to the data bits before transmission?
Consider a processor that has 16 general purpose registers and it uses 2-byte
instruction format for all its instructions. Variable-sized opcodes are permitted.
There are three different types of instructions; M-type, R-type, and C-type. Each
M-type instruction has 2 register operands and a 6-bit immediate operand. Each R-
type instruction has 3 register operands. Each C-type instruction has a register
operand and a 6-bit offset value. If there are 2 unique M-type opcodes and 7 unique
R-type opcodes, which one of the following options gives the maximum number of
unique opcodes possible for C-type instructions?
Consider the control flow graph given below.
Which one of the following options is the set of live variables at the exit point of
each basic block?
An index in a DBMS is said to be dense if an index entry appears for every
search-key value in the indexed file. Otherwise it is called a sparse index. Consider
the following two statements.
S1: A hash index must be a dense index
S2: A ????+ tree index can be a sparse index
Which one of the following options is correct?
Consider the following two finite automata ????1 and ????2.
Which of the following statements is/are true?
Let Σ = {????, ????, ????, ????} and let ????= {????????????????????????????ℓ∣????, ????, ????, ℓ≥0}.
Which of the following constraints ensure(s) that the language ???? is context-free?
Consider a binary search tree (BST) with ???? leaf nodes (????> 0). Given any node ????,
the key present in the node is denoted as ????????????(????). All the keys present in the given
BST are distinct. The keys belong to the set of real numbers.
For a node ????, let ????????????(????) denote the node that is its inorder successor. If a node ????
does not have an inorder successor, then ????????????(????) is ????????????????. As there are no
duplicates, if ????????????(????) is not ????????????????, then ????????????(????) < ????????????(????????????(????)).
Corresponding to every leaf node ???????? that has a non-NULL ????????????(????????), a new key ????????
with the following property is to be inserted into the BST.
????????????(????????) < ????????< ????????????(????????????(????????))
Let ???? represent the list of all such new keys to be inserted into the BST.
Which of the following statements is/are true?
Consider a stack ???? and a queue ????. Both of them are initially empty and have the
capacity to store ten elements each. The elements 1, 2, 3, 4, and 5 arrive one by one,
in that order. When an element arrives, it is assigned either to ???? (pushed on ???? ) or
to ???? (enqueued to ????). Once all the five elements are stored, the output is generated
in two steps. First, stack S is emptied by popping all elements. Then queue ???? is
emptied by dequeueing all elements. The output obtained by following this process
is 4 3 1 2 5 .
Given the output, the objective is to predict whether an element was assigned to ????
or ????.
Which of the following options is/are possible valid assignment(s) of the
elements?
Note: In the options, the notation ???????? denotes that element ???? was assigned to ???? and
???????? denotes that element ???? was assigned to ????.
Consider three processes P1, P2, and P3 running identical code, as shown in the
pseudocode below. A and B are two binary semaphores initialized to 1 and 0,
respectively. X is a shared variable initialized to 0. Each line in the pseudocode is
executed atomically.
Pseudocode of P1, P2, and P3
Wait(A);
Print(*);
X = X+1;
If (X == 2)
{
Print($);
Signal(B);
}
Signal(A);
Wait(B);
Print(#);
Signal(B);
Assume that any of the three processes can start to execute first and context
switching can happen between these processes at any arbitrary time and in any
arbitrary order.
Which of the following patterns is/are possible to be generated as an outcome of the
execution of these three processes?
Consider a system with a processor and a 4 KB direct mapped cache with block size
of 16 bytes. The system has a 16 MB physical memory. Four words P, Q, R, and S
are accessed by the processor in the same order 10 times. That is, there are a total
of 40 memory references in the sequence P, Q, R, S, P, Q, R, S,…
Assume that the cache memory is initially empty. The physical addresses of the
words are given below (1 word =1 byte).
P: 0x845B32, Q: 0x845B26, R: 0x845B36, S: 0x846B32
Which of the following statements is/are true?
Note: 1K=210 and 1M=220
To keep track of free blocks in a file system, one of the two approaches is generally
used - using bitmaps (bit vectors) or using linked lists. Consider that the linked list
approach is used to keep track of free blocks in a file system. Assume that the disk
size is 16 GB, block size is 2 KB, and block numbers used are 32-bit long. A single
pointer of size 4 bytes is used in each block of the list to point to the next block of
the list. The number of blocks required to hold the free disk block numbers is
____________. (answer in integer)
Note: 1K=210 and 1G=230
A system has a Translation Lookaside Buffer (TLB) that has a reach of 1 MB. TLB
reach is defined as the total amount of physical memory that can be accessed
through the TLB entries. The paging system uses pages of size 4 KB. The virtual
address space is 64 GB and physical address space is 1 GB. If each TLB entry stores
a 4-bit process id, page number, frame number, and a 2-bit control field, then the
size of the TLB (in bytes) is ___________. (answer in integer)
Note: 1K=210, 1M=220, 1G=230
Consider contiguous allocation of physical memory to processes using variable
partitioning scheme. Suppose there are 8 holes in the memory of sizes 20 KB, 4 KB,
25 KB, 18 KB, 7 KB, 9 KB, 15 KB, and 12 KB. Assume that no two holes are
adjacent. Two processes P1 of size 16 KB and P2 of size 9 KB arrive in that order,
and they are allocated memory using the best-fit technique. After allocating space
to P1 and P2, the number of holes of size less than 8 KB is ____________. (answer
in integer)
Note: 1K=210
Consider a system with 1 MB physical memory and a word length of 1 byte. The
system uses a direct mapped cache, with block numbers starting from 0. The word
with physical address 0xA2C28 is mapped to the cache block number 17610. The
maximum possible size of the cache (in KB) for this configuration is ___________.
(answer in integer)
Note: 1K=210 and 1M=220
A non-pipelined instruction execution unit that operates at 1.6 GHz clock takes an
average of 5 clock cycles to complete the execution of an instruction. To improve
the performance, the system was pipelined with a goal of achieving an average
throughput of one instruction per clock cycle. However, it could operate only at
1.2 GHz due to pipeline overheads. While executing a program in the pipelined
design, 30% of instructions encountered a stall of 2 cycles due to pipeline hazards.
The speed-up obtained by the pipelined design over the non-pipelined one for this
program is ___________. (rounded off to two decimal places)
Note: 1G=109
Consider a new TCP connection between a sender and a receiver. The receiver
advertised window is constant at 48 KB, the maximum segment size (MSS) is
2 KB, and the slow start threshold for TCP congestion control is 16 KB. Assume
that there are no timeouts or duplicate acknowledgements. The number of rounds
of transmission required for the congestion control algorithm of the TCP connection
to reach the congestion avoidance phase is ___________. (answer in integer)
Note: 1K=210
Consider the digital circuit shown below with two input lines A and B, two select
lines S0 and S1, and an output line Y. The blocks Q and M represent active high
2:4 decoder and 4-to-1 multiplexer, respectively. Out of 16 possible input
combinations, the number of combinations that produce Y=1 is ____________.
(answer in integer)
Note: One input combination is an instance of [A B S1 S0].

Consider the following ANSI-C program.
#include <stdio.h>
int main(){
int *ptr, a, b, c;
a=5; b=11; c=20;
ptr=&a; *ptr=c; ptr=&c;
a=*(&b); c=*ptr-a;
printf("%d",c);
return(0);
}
The output of this program is ____________. (answer in integer)
Note: Assume that the program compiles and runs successfully.
Consider the following ANSI-C function.
int func(int start, int end){
int length=end+1-start;
if((length<1)||(start<0)||(end<0)){ return(0); }
if(length%3==0){
return(func(start+1, end));
} else if(length%3==1){
return(1+func(start, end-1));
} else {
return(func(start+2, end));
}
}
The maximum possible value that can be returned from this function is
____________. (answer in integer)
Note: Ignore syntax errors (if any) in the function.
The determinant of a 4 × 4 matrix A is 3. The value of the determinant of 2A is
____________. (answer in integer)
Suppose an unbiased coin is tossed 6 times. Each coin toss is independent of all
previous coin tosses. Let ????1 be the event that among the second, fourth, and sixth
coin tosses, there are at least two heads. Let ????2 be the event that among the first,
second, third, and fifth coin tosses, there are equal number of heads and tails.
The conditional probability P(????1| ????2) is equal to ____________. (rounded off to
one decimal place)
Consider a function ????: (0,1) →{0, 1} defined as follows.
For a real number ????∈(0,1) , ????(????) = 1 if the second digit after the decimal point
in ???? is one of the four digits 2, 3, 6 and 7. Otherwise, ????(????) is equal to 0.
The number of points in (0,1) at which ???? is discontinuous is ___________. (answer
in integer)
It is necessary to design a link-layer protocol between two hosts that are directly
connected over a lossless link of length 3000 kilometers. Assume that the link
bandwidth is 108 bits per second and that the propagation delay in the link is 5
nanoseconds per meter. Every transmitted data byte is assigned a unique sequence
number.
Let ???? be the minimum number of bits needed for the sequence number field in the
protocol header such that
i.
the sequence numbers do not wrap around before 60 seconds, and
ii.
the maximum utilization of the link is achieved.
The value of ???? is ______. (answer in integer)
GATE 2026 CS-2 Exam Pattern and Marking Scheme Explained
The official GATE 2026 master paper confirms a 100-mark computer-based test with MCQ, MSQ, and NAT formats.
- Total questions: 65, including 10 General Aptitude questions
- Duration: 3 hours in one continuous session
- Question mix: 35 single-correct MCQs, 11 multiple-select questions, and 19 numerical-answer questions
- MCQ marking: one-third negative for a wrong 1-mark MCQ and two-thirds negative for a wrong 2-mark MCQ
- MSQ and NAT marking: no negative marking
High-Weightage Topics in GATE 2026 CS-2 from the Tagged Questions
The counts below come directly from the 65 resolved QACMS topic tags for this official session.
- Computer Organization and Architecture: 7 questions in the tagged paper
- Logical Reasoning: 4 questions in the tagged paper
- Programming in C: 4 questions in the tagged paper
- Database Management Systems: 3 questions in the tagged paper
- Digital Logic: 3 questions in the tagged paper
- Computer Networks: 3 questions in the tagged paper
GATE 2026 CS-2 Official Cutoff and Paper Verification
The official GATE 2026 cutoff page records a CS qualifying mark of 30 for GEN, 27 for OBC-NCL/EWS, and 20 for SC/ST/PwD. IIT Guwahati reports 259,922 registrations and 211,020 appearances for CS.
- Official GATE 2026 master question papers and answer keys
- Official GATE 2026 examination schedule
- Official GATE 2026 CS cutoff marks
GATE 2026 CS-2 Question Paper Detailed Solution Video
Source: YouTube
How to Use the GATE 2026 CS-2 Question Paper for Practice
Use the official timing and the linked explanations to turn this paper into a complete revision test.
- Attempt all 65 questions in a strict 180-minute window
- Check MCQ, MSQ, and NAT responses against the official key after the attempt
- Open the per-question links for step-by-step reasoning instead of checking only the final answer
- Redo questions from the six highest-count topics listed above
- Use the GATE virtual scientific calculator during numerical practice; physical calculators are not permitted
GATE 2026 CS-2 Question Paper with Solutions FAQs
Ques. Where can I download the GATE 2026 CS-2 question paper with solutions PDF?
Ans. Use the Download PDF and Check Solutions links in the table above. The question booklet has 65 questions, and the companion PDF gives a detailed solution for every row.
Ques. Is the GATE 2026 CS-2 paper an official GATE 2026 paper?
Ans. Yes. The questions and all 65 answers were checked against IIT Guwahati's official master paper and associated answer key for this session.
Ques. How many MCQ, MSQ, and NAT questions were in GATE 2026 CS-2?
Ans. The paper contained 35 single-correct MCQs, 11 multiple-select questions, and 19 numerical-answer questions.
Ques. What was the GATE 2026 CS qualifying cutoff?
Ans. The official cutoff was 30 marks for GEN, 27 for OBC-NCL/EWS, and 20 for SC/ST/PwD.
Ques. Can I use a physical calculator while solving GATE CS papers?
Ans. No. GATE provides a virtual scientific calculator inside the CBT interface; physical calculators are not allowed.
Ques. Was GATE 2026 CS conducted in two sessions?
Ans. Yes. CS-1 ran from 9:30 AM to 12:30 PM and CS-2 ran from 2:30 PM to 5:30 PM on February 8, 2026.









Comments