GATE 2026 (Session 1) 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
The antonym of the word protagonist is ________.
The figure shows two -tile patterns.
Either one or both of the patterns can be used any number of times and in any orientation to construct a new pattern. Which one of the options below cannot be constructed by using only these two -tile patterns assuming there are no overlaps among them?
Either one or both of the patterns can be used any number of times and in any orientation to construct a new pattern. Which one of the options below cannot be constructed by using only these two -tile patterns assuming there are no overlaps among them?
Consider a knock-out women's badminton singles tournament where there are no ties. The loser in each game is eliminated from the tournament. Every player plays until she is defeated or remains the last undefeated player. The last undefeated player is declared the winner of the tournament. If there are players in the beginning of the tournament, how many games should be played in total to declare the winner of the tournament?
A student needs to enroll for a minimum of credits. A student cannot enroll for more than credits. The credits are divided amongst project and three distinct sets of courses namely, core courses, specialization courses, and elective courses. It is compulsory for a student to enroll for exactly credits of core courses and exactly credits of project. In addition, a student has to enroll for a minimum of credits of specialization courses. The maximum credits of elective courses that a student can enroll for is ________
When the teacher is in the room, all students stand silently.'
If the above statement is true, which one of the following statements is not necessarily true?
If the above statement is true, which one of the following statements is not necessarily true?
Combinatorics deals with problems involving counting. For example, "How many distinct arrangements of distinct objects in spaces on a circle are possible?" is a typical problem in combinatorics. This kind of counting is sometimes used in the modeling of several physical phenomena. Often, in such models, the different combinatorial possibilities are assigned probability values. Assigning probabilities enables the computation of the average values of physical quantities.
Consider the following statements:
Combinatorics is always invoked in the modeling of physical phenomena.
Modeling some physical phenomena involves assigning probabilities to combinatorial possibilities in order to compute average values of physical quantities.
Based on the passage above, what can be inferred about statements and
Consider the following statements:
Combinatorics is always invoked in the modeling of physical phenomena.
Modeling some physical phenomena involves assigning probabilities to combinatorial possibilities in order to compute average values of physical quantities.
Based on the passage above, what can be inferred about statements and
In Panel of the figure below, the front view and top view of a structure are shown. Which one of the structures shown in Panel possesses the views shown in Panel ?
For positive real numbers and , the function is defined as: . The max function is defined as:
The graph below shows the plot of a function versus .
can be expressed as _____.
The graph below shows the plot of a function versus .
can be expressed as _____.
In the summer Olympics' Javelin throw finals, Neeraj Chopra exhibited a spectacular performance to win the gold medal. The silver medal was won by Jakub Vadlejch and the bronze medal was won by Vitezlav Vesely. There were six rounds of throws with each athlete having one throw per round. The best of all the throws of each athlete is considered for the medal. Following were the observations about the throws:
i.) The first and second rounds were dominated by Neeraj Chopra with a gold medal performance in his second throw, while the other two athletes did not have any medal winning throws in these rounds.
ii.) The throws in the last round by both Jakub Vadlejch and Vitezlav Vesely were fouls and were not considered for scoring.
iii.) After four rounds, Vitezlav Vesely was in the second position and could not improve upon his best throw in the succeeding rounds.
iv.) In the fourth round, the throw by Jakub Vadlejch was the best in that round.
In which round did Vitezlav Vesely have his best throw?
i.) The first and second rounds were dominated by Neeraj Chopra with a gold medal performance in his second throw, while the other two athletes did not have any medal winning throws in these rounds.
ii.) The throws in the last round by both Jakub Vadlejch and Vitezlav Vesely were fouls and were not considered for scoring.
iii.) After four rounds, Vitezlav Vesely was in the second position and could not improve upon his best throw in the succeeding rounds.
iv.) In the fourth round, the throw by Jakub Vadlejch was the best in that round.
In which round did Vitezlav Vesely have his best throw?
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 number appearing in the second roll is an integer multiple of the number appearing in the first roll is ________
An urn contains one red ball and one blue ball. At each step, a ball is picked uniformly at random from the urn, and this ball together with another ball of the same color is put back in the urn. The probability that there are equal number of red and blue balls after two steps is
Consider matrices with their elements from . The number of such matrices with even number of s in every row and every column is
For , the maximum multiplicity of any eigenvalue of an matrix with elements from is
Match each addressing mode in with a data element or an element of a data structure (in a high-level language) in :
Consider a processor whose instruction set architecture is the load-store architecture. The instruction format is such that the first operand of any instruction is the destination operand.
Which one of the following sequences of instructions corresponds to the high-level language statement ?
Note: X, Y, and Z are memory operands. R, R, and R are registers.
Which one of the following sequences of instructions corresponds to the high-level language statement ?
Note: X, Y, and Z are memory operands. R, R, and R are registers.
Which one of the following dependencies among the register operands of different instructions can cause a data hazard in a pipelined processor?
Consider the following recurrence relations:
For all ,
Assume that for all and .
Which one of the following options is correct?
For all ,
Assume that for all and .
Which one of the following options is correct?
With respect to a TCP connection between a client and a server, which one of the following statements is true?
Which of the following statements is/are true with respect to the interaction of a web browser with a web server using HTTP ?
Let . Consider an matrix with its elements from . Let the vector be in the null space of .
Which of the following options is/are always correct?
Which of the following options is/are always correct?
Consider the following Boolean expression of a function :
Which of the following expressions is/are equivalent to ?
Which of the following expressions is/are equivalent to ?
Consider the -bit signed integers and represented using the sign-magnitude form. The binary representations of and are as follows:
Which of the following operations to compute result(s) in an arithmetic overflow?
Which of the following operations to compute result(s) in an arithmetic overflow?
Let be an odd number greater than . Consider a binary minheap with elements stored in an array whose index starts from .
Which of the following indices of do/does NOT correspond to any leaf node of the minheap?
Which of the following indices of do/does NOT correspond to any leaf node of the minheap?
Consider a hash table that is initially empty. The hash table is maintained using open addressing with linear probing. The hash function used is .
Consider the following sequence of insertions performed on :
Which of the following positions in the hash table is/are empty after these insertions are performed?
Consider the following sequence of insertions performed on :
Which of the following positions in the hash table is/are empty after these insertions are performed?
Consider the following grammar where is the start symbol, and and are terminal symbols.
Which of the following statements is/are true?
Which of the following statements is/are true?
Let be a nondeterministic finite automaton (NFA) with states over a finite alphabet.
Which of the following options CANNOT be the number of states in the minimal deterministic finite automaton (DFA) that is equivalent to ?
Which of the following options CANNOT be the number of states in the minimal deterministic finite automaton (DFA) that is equivalent to ?
Consider the following C statements:
char *str1 = "Hello; /* Statement S1 */
char *str2 = "Hello;"; /* Statement S2 */
int *str3 = "Hello"; /* Statement S3 */
Which of the following options is/are correct?
char *str1 = "Hello; /* Statement S1 */
char *str2 = "Hello;"; /* Statement S2 */
int *str3 = "Hello"; /* Statement S3 */
Which of the following options is/are correct?
Which of the following statements is/are true?
With respect to deadlocks in an operating system, which of the following statements is/are FALSE?
Let and be the attributes of a relation in a relational schema. Let indicate functional dependency in the context of a relational database, where .
Which of the following options is/are always true?
Which of the following options is/are always true?
In the context of relational database normalization, which of the following statements is/are true?
Consider the function defined as follows:
where .
If is continuous at , then ________. (answer in integer)
where .
If is continuous at , then ________. (answer in integer)
The height of a binary tree is the number of edges in the longest path from the root to a leaf in the tree. The maximum possible height of a full binary tree with nodes is ________.(answer in integer)
Consider the following program in C:
Note: Assume that the program compiles and runs successfully.
#include <stdio.h>
void func(int i, int j) {
if(i < j) {
int i = 0;
while (i < 10) {
j += 2;
i++;
}
}
printf("%d", i);
}
int main() {
int i = 9, j = 10;
func(i, j);
return 0;
} The output of the program is ________. (answer in integer)Note: Assume that the program compiles and runs successfully.
Consider a system consisting of instances of a resource , being shared by processes. Assume that each process requires a maximum of two instances of resource and a process can request or release only one instance at a time. Further, a process can request the second instance of the resource only after acquiring the first instance.
The minimum value of for the system to be deadlock-free is ________. (answer in integer)
The minimum value of for the system to be deadlock-free is ________. (answer in integer)
Consider the real valued variables and represented using the IEEE singleprecision floating-point format. The binary representations of and in hexadecimal notation are as follows:
Let .
Which one of the following is the binary representation of , in hexadecimal notation?
Let .
Which one of the following is the binary representation of , in hexadecimal notation?
Consider a -bit saturating up/down counter that performs the saturating up count when the input is , and the saturating down count when is . The Next State table of the counter is as shown. The counter is built as a synchronous sequential circuit using D flip-flops.
Which one of the following options corresponds to the expressions for the inputs of the D flip-flops, and ?
Which one of the following options corresponds to the expressions for the inputs of the D flip-flops, and ?
The size of the physical address space of a processor is bytes. The capacity of a cache memory unit is bytes. The cache block size is bytes. The cache memory unit can be built as a direct mapped cache or as a -way set-associative cache, where and . Let the length of the TAG field be bits for the direct mapped cache, and bits for the set-associative cache.
Which one of the following options is true?
Which one of the following options is true?
Consider the following code snippet in C language that computes the number of nodes in a non-empty singly linked list pointed to by the pointer variable head.
struct node{
int elt;
struct node *next;
};
int getListSize (struct node *head)
{
if( E1 ) return 1;
return E2 ;
} Which one of the following options gives the correct replacements for the expressions and Let be the set of all integers from to . Consider any order of insertion of the elements of into a binary search tree that creates a complete binary tree.
Which one of the following elements can NEVER be the third element that is inserted?
Which one of the following elements can NEVER be the third element that is inserted?
Let be an undirected, edge-weighted graph with integer weights. The weight of a path is the sum of the weights of the edges in that path. The length of a path is the number of edges in that path.
Let be a vertex in . For every and for every , let denote the weight of a shortest path (in terms of weight) from to of length at most . If there is no path from to of length at most , then .
Consider the statements:
S1: For every and .
S2: For every , if is part of a shortest path (in terms of weight) from to , then for every .
Which one of the following options is correct?
Let be a vertex in . For every and for every , let denote the weight of a shortest path (in terms of weight) from to of length at most . If there is no path from to of length at most , then .
Consider the statements:
S1: For every and .
S2: For every , if is part of a shortest path (in terms of weight) from to , then for every .
Which one of the following options is correct?
Consider the control flow graph shown in the figure.
Which one of the following options correctly lists the set of redundant expressions (common subexpressions) in the basic blocks B and B?
Note: All the variables are integers.
Which one of the following options correctly lists the set of redundant expressions (common subexpressions) in the basic blocks B and B?
Note: All the variables are integers.
Consider a relational database schema with two relations and . Let be a tuple relational calculus expression.
Which one of the following relational algebraic expressions is equivalent to ?
Which one of the following relational algebraic expressions is equivalent to ?
A TCP sender successfully establishes a connection with a TCP receiver and starts the transmission of segments. The TCP congestion control mechanism's slow-start threshold is set to segments. Assume that the round-trip time is fixed at millisecond. Assume that the sender always has data to send, the segments are numbered from , and no segment is lost. Let denote the time (in milliseconds) at which the transmission of segment number starts.
Which one of the following options is correct?
Which one of the following options is correct?
Consider the implementation of sliding window protocol over a lossless link, with a window size of frames, where each frame is of size bits (including header). The bandwidth of the link is and the one-way propagation delay is milliseconds. Assume that processing times at the sender and receiver are zero and the transmission time of acknowledgements is also zero. Which one of the following options gives the minimum size of (in number of frames) required to achieve link utilization?
Let be defined as follows:
Which of the following statements is/are true?
Which of the following statements is/are true?
Let be a simple, undirected graph. A vertex cover of is a subset such that for every or . Let the size of the smallest vertex cover in be . Let be any vertex cover of size .
For a vertex , which of the following constraints will always ensure that ?
For a vertex , which of the following constraints will always ensure that ?
Consider a Boolean function with the following minterm expression:
Which of the following options is/are the minimal sum-of-products expression(s) of ?
Which of the following options is/are the minimal sum-of-products expression(s) of ?
Let be a simple, undirected, edge-weighted graph with unique edge weights. Which of the following statements about the minimum spanning trees (MST) of is/are true?
Consider the following pseudocode for depth-first search (DFS) algorithm which takes a directed graph as input, where and are the discovery time and finishing time, respectively, of the vertex .
Suppose that the input directed graph is a directed acyclic graph (DAG). For an edge , which of the following options will NEVER be correct?
Suppose that the input directed graph is a directed acyclic graph (DAG). For an edge , which of the following options will NEVER be correct?
Let and be two languages over a finite alphabet, such that and are regular languages.
Which of the following statements is/are always true?
Which of the following statements is/are always true?
Consider the following context-free grammar .
In the above grammar, is the start symbol, and are terminal symbols, and and are non-terminal symbols.
Let be the language generated by the grammar . For a string , let be the number of 's in and be the number of 's in .
Which of the following statements is/are true?
In the above grammar, is the start symbol, and are terminal symbols, and and are non-terminal symbols.
Let be the language generated by the grammar . For a string , let be the number of 's in and be the number of 's in .
Which of the following statements is/are true?
Consider the following two syntax-directed definitions and for type declarations.
is the start symbol, and int, float and id are the three terminals. The non-terminal is the same as and the non-terminal is the same as . Here, the subscript is used to differentiate the grammar symbols on the two sides of a production. The function put updates the symbol table with the type information for an identifier.
Let and be the languages specified by grammars and , respectively. Which of the following statements is/are true?
is the start symbol, and int, float and id are the three terminals. The non-terminal is the same as and the non-terminal is the same as . Here, the subscript is used to differentiate the grammar symbols on the two sides of a production. The function put updates the symbol table with the type information for an identifier.
Let and be the languages specified by grammars and , respectively. Which of the following statements is/are true?
Consider a system that has a cache memory unit and a memory management unit (MMU). The address input to the cache memory is a physical address. The MMU has a translation lookaside buffer (TLB). Assume that when a page is evicted from the main memory, the corresponding blocks in the cache are marked as invalid.
For a given memory reference, which of the following sequences of events can NEVER happen?
For a given memory reference, which of the following sequences of events can NEVER happen?
An undirected, unweighted, simple graph is said to be -colorable if there exists a function such that for every .
Which of the following statements about -colorable graphs is/are true?
Which of the following statements about -colorable graphs is/are true?
An ISP having an address block assigns a block of IP addresses to a client, using the classless internet domain routing (CIDR) super-netting approach. Which of the following address blocks can be assigned by the ISP?
Let be an undirected graph, which is a path on vertices. The number of matchings in is ________. (answer in integer)
Let be a random variable which takes values in the set . Further, and .
The expected value of , denoted by , is equal to ________. (rounded off to two decimal places)
The expected value of , denoted by , is equal to ________. (rounded off to two decimal places)
Consider a hard disk with a rotational speed of rpm. The time to move the read/write head from a track to its adjacent track is millisecond. Initially, the head is on track . The number of sectors per track is . The sector size is bytes. It is necessary to transfer data from randomly located sectors in each of the following tracks in the order: and .
The total time for the data transfer (in milliseconds) from the hard disk is ________. (rounded off to one decimal place)
The total time for the data transfer (in milliseconds) from the hard disk is ________. (rounded off to one decimal place)
The EX stage of a pipelined processor performs the memory read operations for LOAD instructions, and the operations for the arithmetic and logic instructions. Let denote the time taken by the EX stage to perform the operation for an instruction. For each instruction type, the values of and (the number of instructions of that type in a sequence of instructions for a program P ), are given in the table below.
The duration of the pipeline clock cycle is nanosecond. Assume that the latch time for the interstage buffers in the pipeline is negligible.
When program is executed, the number of clock cycles for which the pipeline is stalled due to structural hazards in the EX stage is ________. (answer in integer)
The duration of the pipeline clock cycle is nanosecond. Assume that the latch time for the interstage buffers in the pipeline is negligible.
When program is executed, the number of clock cycles for which the pipeline is stalled due to structural hazards in the EX stage is ________. (answer in integer)
Consider the recursive functions represented by the following code segment:
Note: Ignore syntax errors (if any) in the function.
int bar(int n) {
if (n == 1) return 0;
else return 1 + bar(n/2);
}
int foo(int n) {
if (n == 1) return 1;
else return 1 + foo(bar(n));
} The smallest positive integer n for which returns is ________. (answer in integer) Note: Ignore syntax errors (if any) in the function.
The following sequence corresponds to the preorder traversal of a binary search tree :
The position of the element in the postorder traversal of is ________ . (answer in integer)
Note: The position begins with .
The position of the element in the postorder traversal of is ________ . (answer in integer)
Note: The position begins with .
Consider the following program snippet. Assume that the program compiles and runs successfully. Further, assume that the fork() system call is always successful in creating a process.
int main () {
int i;
for (i = 0; i < 3; i++) {
if (fork() == 0) {
continue;
}
break;
}
printf("Hello!");
return 0;
} The total number of times that the printf statement gets executed is ________. (answer in integer)Consider a CPU that has to execute two types of processes. The first type, Actuators (A), requires a CPU burst of seconds. The second type, Controllers (C), requires a CPU burst of seconds. A new process of type A arrives at time , , and (in seconds). Similarly, a new process of type C arrives at time , and (in seconds). The CPU scheduling policy is First Come First Serve (FCFS). The first process of type A starts running at seconds. The average waiting time (in seconds) for the processes is ________. (rounded off to one decimal place)
Consider a relational database schema with a relation . If and are the only two candidate keys of the relation , then the number of superkeys of relation is ________. (answer in integer)
GATE 2026 (Session 1) 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.