GATE 2026 (Session 2) CS Mock Test
General Instructions
- The test lasts 180 minutes. The timer above the question shows the time left, and the test is submitted automatically when it reaches zero.
- The question palette shows the status of each question:
1 You have not visited the question yet. 2 You have not answered the question. 3 You have answered the question. It will be evaluated. 4 You have not answered the question but marked it for review. 5 You have answered the question and marked it for review. It will also be evaluated. - Save & Next saves your answer and moves to the next question. Mark for Review & Next saves it, marks it for review and moves on. Clicking a number in the palette moves to that question without saving the current answer.
- MCQ: one correct option; a wrong answer costs 1/3 of the marks for a 1-mark question and 2/3 for a 2-mark one. MSQ: one or more correct options, all of them needed; no negative marks. NAT: type a number with the on-screen keypad; no negative marks.
- A scientific calculator, like the one in GATE, opens from the calculator icon next to the timer.
- Your answers are kept in this browser only. If you close the page, you can resume until the time runs out.
ⓘ Tick the box above to start.
Question No. 1
Expedite, Hasten, Hurry, ________
Fill the blank by choosing a word with a meaning similar to that of the words given above.
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 Which one of the shapes in Panel is the other part?
A day can only be cloudy or sunny. The probability of a day being cloudy is , 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 and Stock on a particular day are Rs. and Rs. , respectively. An investor invests Rs. in Stock and Rs. in Stock . He sells all the stocks the next day when the value of Stock is Rs. and Stock is Rs. . 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?
Based only on this sentence, which one of the following options is necessarily true?
Water : : Food :
Choose the and combination from the options below to form a meaningful analogy.
Choose the and combination from the options below to form a meaningful analogy.
Two tiles are missing in Panel . Which one of the options in Panel is the appropriate choice for the missing tiles?
Figures and 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?
Which one of the following options is then true?
The figure in Panel 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 below represents the grid shaded correctly?
An unbiased six-faced dice whose faces are marked with numbers , and 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 knows .
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?
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 represents various traversals over binary tree. The set represents the order of visiting nodes during a traversal.
Which one of the following is the correct match from to ?
Which one of the following is the correct match from to ?
Which one of the following statements is equivalent to the following assertion?
Turing machine decides the language
Turing machine decides the language
The probability density function of a random variable which takes real values is
Which one of the following statements is correct about the random variable ?
Which one of the following statements is correct about the random variable ?
In the context of DBMS, consider the two sets and given below.
Which one of the following is the correct match from to ?
Which one of the following is the correct match from to ?
Which one of the following options is not a property of Boolean Algebra?
Note: is OR operation, is AND operation, and is NOT operation
Note: is OR operation, is AND operation, and is NOT operation
In C runtime environment, which one of the following is stored in heap?
Consider the following two statements about interrupt handling mechanisms in a CPU.
: 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.
: 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 and
: 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.
: 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 and
Consider the following three ANSI-C programs, and .
Which one of the following statements is true?
Which one of the following statements is true?
Consider concurrent execution of two transactions and 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 million bytes being transferred between two hosts connected via a path consisting of three consecutive links of bandwidth Mbps , kbps , and 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:
Which one of the following is the total time (in seconds) to transfer the file?
Note:
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.
Which one of the following options lists the functions in increasing order of asymptotic growth rate?
Note: Assume the base of log to be .
Which one of the following options lists the functions in increasing order of asymptotic growth rate?
Note: Assume the base of log to be .
Which of the following can be recurrence relation(s) corresponding to an algorithm with time complexity ?
Let be a binary relation on the set , 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 . Which of the following statements is/are true?
In a system, numbers are represented using -bit two's complement form. Consider four numbers and in the system. Which of the following operations will result in arithmetic overflow?
Which of the following grammars is/are ambiguous?
The keys are inserted into a hash table using the hash function . 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.
Suppose the values of and are chosen such that the system of linear equations produce multiple solutions. Then the product of and is ________. (answer in integer)
Suppose the values of and are chosen such that the system of linear equations produce multiple solutions. Then the product of and is ________. (answer in integer)
Consider an array . 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 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 merge operations is ________. (answer in integer)
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 merge operations is ________. (answer in integer)
If an IP network uses a subnet mask of , the maximum number of IP addresses that can be assigned to network interfaces is ________. (answer in integer)
The -bit single precision representation of a number is . The number in decimal representation is ________. (rounded off to two decimal places)
A lexical analyzer uses the following token definitions
For the string given below,
the number of tokens (excluding ws) that will be produced by the lexical analyzer is ________. (answer in integer)
For the string given below,
the number of tokens (excluding ws) that will be produced by the lexical analyzer is ________. (answer in integer)
Consider a complete graph with vertices ( ). 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 ?
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 to . An algorithm is to be designed to check whether satisfies the condition given below.
such that
Which one of the following gives the worst case time complexity of the fastest algorithm that can be designed for the problem?
such that
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 , 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:
Consider the following two algorithms to compute entries of . Assume that for both the algorithms, for all has been initialized to .
Algorithm is said to be correct if and only if it calculates the correct values of , for all , (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 two algorithms to compute entries of . Assume that for both the algorithms, for all has been initialized to .
Algorithm is said to be correct if and only if it calculates the correct values of , for all , (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 -variable Boolean function
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 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 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 ACTION table?
Which one of the following options gives the number of shift-reduce conflicts that will occur in the ACTION table?
In the context of schema normalization in relational DBMS, consider a set of functional dependencies. The set of all functional dependencies implied by is called the closure of . To compute the closure of , 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?
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 over a link that uses Cyclic Redundancy Check (CRC) code for error detection. If the generator bit pattern is given to be , which one of the following options shows the remainder bit pattern appended to the data bits before transmission?
Consider a processor that has general purpose registers and it uses -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 register operands and a -bit immediate operand. Each Rtype instruction has register operands. Each C-type instruction has a register operand and a -bit offset value. If there are unique M-type opcodes and 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?
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.
: A hash index must be a dense index
: A tree index can be a sparse index
Which one of the following options is correct?
: A hash index must be a dense index
: A tree index can be a sparse index
Which one of the following options is correct?
Consider the following two finite automata and .
Which of the following statements is/are true?
Which of the following statements is/are true?
Let and let .
Which of the following constraints ensure(s) that the language is context-free?
Which of the following constraints ensure(s) that the language is context-free?
Consider a binary search tree (BST) with leaf nodes . 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?
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 , and 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 .
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 .
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 , and running identical code, as shown in the pseudocode below. and are two binary semaphores initialized to and , respectively. is a shared variable initialized to . Each line in the pseudocode is executed atomically.
Pseudocode of P1, P2, and P3
Which of the following patterns is/are possible to be generated as an outcome of the execution of these three processes?
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 KB direct mapped cache with block size of bytes. The system has a MB physical memory. Four words , and S are accessed by the processor in the same order times. That is, there are a total of memory references in the sequence
Assume that the cache memory is initially empty. The physical addresses of the words are given below ( word byte).
Which of the following statements is/are true?
Note: and
Assume that the cache memory is initially empty. The physical addresses of the words are given below ( word byte).
Which of the following statements is/are true?
Note: and
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 GB , block size is KB , and block numbers used are -bit long. A single pointer of size 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: and
Note: and
A system has a Translation Lookaside Buffer (TLB) that has a reach of 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 KB. The virtual address space is GB and physical address space is GB. If each TLB entry stores a -bit process id, page number, frame number, and a -bit control field, then the size of the TLB (in bytes) is ________. (answer in integer)
Note:
Note:
Consider contiguous allocation of physical memory to processes using variable partitioning scheme. Suppose there are holes in the memory of sizes , , and . Assume that no two holes are adjacent. Two processes of size and of size arrive in that order, and they are allocated memory using the best-fit technique. After allocating space to and , the number of holes of size less than is ________. (answer in integer)
Note:
Note:
Consider a system with MB physical memory and a word length of byte. The system uses a direct mapped cache, with block numbers starting from . The word with physical address is mapped to the cache block number . The maximum possible size of the cache (in KB ) for this configuration is ________. (answer in integer)
Note: and
Note: and
A non-pipelined instruction execution unit that operates at GHz clock takes an average of 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 GHz due to pipeline overheads. While executing a program in the pipelined design, of instructions encountered a stall of 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:
Note:
Consider a new TCP connection between a sender and a receiver. The receiver advertised window is constant at KB, the maximum segment size (MSS) is KB, and the slow start threshold for TCP congestion control is 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:
Note:
Consider the digital circuit shown below with two input lines and , two select lines and , and an output line . The blocks and represent active high decoder and -to- multiplexer, respectively. Out of possible input combinations, the number of combinations that produce is ________ (answer in integer)
Note: One input combination is an instance of [].
Note: One input combination is an instance of [].
Consider the following ANSI-C program.
Note: Assume that the program compiles and runs successfully.
#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.
Note: Ignore syntax errors (if any) in the 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 matrix is . The value of the determinant of is ________. (answer in integer)
Suppose an unbiased coin is tossed times. Each coin toss is independent of all previous coin tosses. Let be the event that among the second, fourth, and sixth coin tosses, there are at least two heads. Let be the event that among the first, second, third, and fifth coin tosses, there are equal number of heads and tails.
The conditional probability is equal to ________ (rounded off to one decimal place)
The conditional probability is equal to ________ (rounded off to one decimal place)
Consider a function defined as follows.
For a real number , if the second digit after the decimal point in is one of the four digits and . Otherwise, is equal to .
The number of points in at which is discontinuous is ______. (Answer in integer)
For a real number , if the second digit after the decimal point in is one of the four digits and . Otherwise, is equal to .
The number of points in 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 kilometers. Assume that the link bandwidth is bits per second and that the propagation delay in the link is 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 seconds, and
(ii) the maximum utilization of the link is achieved.
The value of is ______. (answer in integer)
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 seconds, and
(ii) the maximum utilization of the link is achieved.
The value of is ______. (answer in integer)
GATE 2026 (Session 2) CS Mock Test: your result
Question-wise review
The timer is still running. Close this window to return to the questions.
The timer is still running while you read the paper.
Submit the test?
You cannot change your answers after submitting.