Previous year paper
GATE CS 2025 Set 1
GATE 2025 Computer Science and Information Technology - Session 1 (CS1)
Take this paper as a mock testGATE CS 2025GATE CS 2025 Set 2
General Aptitude
10 questions, 15 marks
Q.1
Ravi had ______ younger brother who taught at ______ university. He was widely regarded as ______ honorable man. Select the option with the correct sequence of articles to fill...
Verbal Ability and Grammar
Q.2
The CEO's decision to downsize the workforce was considered myopic because it sacrificed long-term stability to accommodate short-term gains. Select the most appropriate option...
Verbal Ability and Grammar
Q.3
The average marks obtained by a class in an examination were calculated as . However, while checking the marks entered, the teacher found that the marks of one student wer...
Quantitative Aptitude
Q.4
Consider the relationships among P, Q, R, S, and T: P is the brother of Q. S is the daughter of Q. T is the sister of S. R is the mother of Q. The following statements are made...
Analytical and Logical Reasoning
Q.5
According to the map shown in the figure, which one of the following statements is correct? Note: The figure shown is representative. Campus map showing 1st Main Road running No...
Spatial Aptitude
Q.6
"I put the brown paper in my pocket along with the chalks, and possibly other things. I suppose every one must have reflected how primeval and how poetical are the things that o...
Reading Comprehension and Verbal Deduction
Q.7
In the diagram, the lines and are parallel to each other. The shortest distance between these two lines is half the shortest distance between the point and line…
Quantitative Aptitude
Q.8
A fair six-faced dice, with the faces labelled '1', '2', '3', '4', '5', and '6', is rolled thrice. What is the probability of rolling '6' exactly once?
Quantitative Aptitude
Q.9
A square paper, shown in figure (I), is folded along the dotted lines as shown in the figures (II) and (III). Then a few cuts are made as shown in figure (IV). Which one of the...
Spatial Aptitude
Q.10
A shop has 4 distinct flavors of ice-cream. One can purchase any number of scoops of any flavor. The order in which the scoops are purchased is inconsequential. If one wants to...
Quantitative Aptitude
Computer Science and Information Technology
55 questions, 85 marks
Q.11
Suppose a program is running on a non-pipelined single processor computer system. The computer is connected to an external device that can interrupt the processor asynchronously...
I/O Interface, Interrupts and DMA
Q.12
Which ONE of the following statements is FALSE regarding the symbol table?
Lexical Analysis
Q.13
Which ONE of the following techniques used in compiler code optimization uses live variable analysis?
Intermediate Code Generation, Data Flow Analysis and Code Optimization
Q.14
Consider a demand paging memory management system with 32-bit logical address, 20-bit physical address, and page size of 2048 bytes. Assuming that the memory is byte addressable...
Memory Management and Virtual Memory
Q.15
A schedule of three database transactions , , and is shown. and denote read and write of data item by transaction , . The...
Transactions, Serializability and Concurrency Control
Q.16
Identify the ONE CORRECT matching between the OSI layers and their corresponding functionalities as shown. OSI Layers Functionalities (a) Network layer (I) Packet routing (b) Tr...
OSI/TCP-IP Layering, Physical Layer and Switching
Q.17
is a function from to , is a function from to , and their composition defined as is a mapping from to . If and are...
Sets, Relations, Functions, Partial Orders and Lattices
Q.18
Let be any undirected graph with positive edge weights, and be a minimum spanning tree of . For any two vertices, and , let and be the...
Minimum Spanning Trees
Q.19
Consider the following context-free grammar , where , , and are the variables (non-terminals), and are the terminal symbols, is the start variable, and...
Context-Free Grammars, Pushdown Automata and CFLs
Q.20
Consider the following recurrence relation: Which ONE of the following options is CORRECT?
Asymptotic Analysis and Time/Space Complexity
Q.21
Consider the following tree with 5 nodes, in which a node can store at most 3 key values. The value is now inserted in the tree. Which of the following options(...
File Organization, B-Trees and B+ Trees Indexing
Q.22
Consider the 3-way handshaking protocol for TCP connection establishment. Let the three packets exchanged during the connection establishment be denoted as P1, P2, and P3, in or...
Transport Layer: UDP, TCP Flow and Congestion Control, Sockets
Q.23
Consider the given system of linear equations for variables and , where is a real-valued constant. Which of the following option(s) is/are CORRECT? …
Linear Algebra
Q.24
Let be a 3-variable Boolean function that produces output as '1' when at least two of the input variables are '1'. Which of the following statement(s) is/are CORRECT, where...
Boolean Algebra and Logic Minimization
Q.25
The number can be represented as in 4-bit 2's complement representation. Which of the following is/are CORRECT 2's complement representation(s) of ?
Number Representations and Computer Arithmetic
Q.26
Which of the following statement(s) is/are TRUE for any binary search tree (BST) having distinct integers?
Binary Trees, Binary Search Trees and Balanced Trees
Q.27
A partial data path of a processor is given in the figure, where RA, RB, and RZ are 32-bit registers. Which option(s) is/are CORRECT related to arithmetic operations using the d...
ALU, Datapath and Control Unit
Q.28
A regular language is accepted by a non-deterministic finite automaton (NFA) with states. Which of the following statement(s) is/are FALSE?
Regular Expressions, Finite Automata and Regular Languages
Q.29
Suppose in a multiprogramming environment, the following C program segment is executed. A process goes into I/O queue whenever an I/O related operation is performed. Assume that...
Processes, Threads and System Calls
Q.30
Let be the set of all ternary strings defined over the alphabet . Consider all strings in that contain at least one occurrence of two consecutive symbols, t...
Combinatorics, Counting, Recurrence Relations and Generating Functions
Q.31
Consider the given function . If the function is differentiable ever...
Calculus
Q.32
A box contains 5 coins: 4 regular coins and 1 fake coin. When a regular coin is tossed, the probability and for a fake coin, . You pic...
Probability and Statistics
Q.33
The pseudocode of a function
fun()is given below: fun(int A[0,...,n-1]){ for i=0 to n-2 for j=0 to n-i-2 if (A[j]>A[j+1]) then swap A[j] and A[j+1] } Let be...Searching and Sorting Algorithms
Q.34
#include <stdio.h> void foo(int *p, int x){ *p=x; } int main(){ int *z; int a = 20, b = 25; z = &a; foo(z,b); printf("%d",a); return 0; } The output of the given C program is __...
Pointers, Arrays and Strings
Q.35
The height of any rooted tree is defined as the maximum number of edges in the path from the root node to any leaf node. Suppose a Min-Heap stores 32 keys. The height of ...
Binary Heaps and Priority Queues
Q.36
Consider a memory system with 1M bytes of main memory and 16K bytes of cache memory. Assume that the processor generates 20-bit memory address, and the cache block size is 16 by...
Memory Hierarchy: Cache, Main Memory and Secondary Storage
Q.37
A processor has 64 general-purpose registers and 50 distinct instruction types. An instruction is encoded in 32-bits. What is the maximum number of bits that can be used to stor...
Machine Instructions and Addressing Modes
Q.38
A computer has two processors, and . Four processes with CPU bursts of 20, 16, 25, and 10 milliseconds, respectively, arrive at the same time and...
CPU Scheduling
Q.39
Consider two relations describing and in a sports league: : are...
Relational Algebra and Tuple Relational Calculus
Q.40
A packet with the destination IP address
145.36.109.70arrives at a router whose routing table is shown. Which interface will the packet be forwarded to? Subnet Address Subnet...IPv4/IPv6 Addressing, Subnetting, CIDR, ARP, ICMP and NAT
Q.41
Let be a matrix as given. What are the eigenvalues of the matrix ?
Linear Algebra
Q.42
Consider the following four variable Boolean function in sum-of-product form where the value of the function is compute...
Boolean Algebra and Logic Minimization
Q.43
Let be an undirected and unweighted graph with 100 vertices. Let denote the number of edges in a shortest path between vertices and in . Let the m...
Graph Traversals, Topological Sort and Connectivity
Q.44
Consider the following two languages over the alphabet : …
Regular Expressions, Finite Automata and Regular Languages
Q.45
Consider the following two languages over the alphabet , where and are natural numbers. …
Context-Free Grammars, Pushdown Automata and CFLs
Q.46
Which of the following statement(s) is/are TRUE while computing First and Follow during top down parsing by a compiler?
Parsing and Syntax Analysis (LL and LR)
Q.47
Consider a relational schema , with functional dependencies…
Functional Dependencies and Normalization
Q.48
Which of the following predicate logic formulae/formula is/are CORRECT representation(s) of the statement: "Everyone has exactly one mother"? The meanings of the predicates used...
Propositional and First-Order Logic
Q.49
is the set of non-negative integers. Let be the set of functions from to itself. For any two functions, , we define…
Monoids and Groups
Q.50
Consider the following deterministic finite automaton (DFA) defined over the alphabet, . Identify which of the following language(s) is/are accepted by the gi...
Regular Expressions, Finite Automata and Regular Languages
Q.51
A disk of size 512M bytes is divided into blocks of 64K bytes. A file is stored in the disk using linked allocation. In linked allocation, each data block reserves 4 bytes to st...
File Systems, I/O and Disk Scheduling
Q.52
Refer to the given 3-address code sequence. This code sequence is split into basic blocks. The number of basic blocks is ________. (Answer in integer) 1001: i = 1 1002: j = 1 10...
Intermediate Code Generation, Data Flow Analysis and Code Optimization
Q.53
A computer has a memory hierarchy consisting of two-level cache (L1 and L2) and a main memory. If the processor needs to access data from memory, it first looks into L1 cache. I...
Memory Hierarchy: Cache, Main Memory and Secondary Storage
Q.54
In optimal page replacement algorithm, information about all future page references is available to the operating system (OS). A modification of the optimal page replacement alg...
Memory Management and Virtual Memory
Q.55
Consider the following database tables of a sports league.
player(pid,pname,age)coach(cid,cname)team(tid,tname,city,cid)members(pid,tid)An instance of the table and...SQL Queries and Integrity Constraints
Q.56
Suppose a 5-bit message is transmitted from a source to a destination through a noisy channel. The probability that a bit of the message gets flipped during transmission is…
Data Link Layer: Framing, Error Detection and Sliding Window
Q.57
Suppose a message of size 15000 bytes is transmitted from a source to a destination using IPv4 protocol via two routers as shown in the figure. Each router has a defined maximum...
IPv4/IPv6 Addressing, Subnetting, CIDR, ARP, ICMP and NAT
Q.58
Consider a probability distribution given by the density function .…
Probability and Statistics
Q.59
Consider a finite state machine (FSM) with one input and one output , represented by the given state transition table. The minimum number of states required to realize th...
Sequential Circuits, Counters and Registers
Q.60
Consider the given sequential circuit designed using D-Flip-flops. The circuit is initialized with some value (initial state). The number of distinct states the circuit will go...
Sequential Circuits, Counters and Registers
Q.61
#include <stdio.h> int foo(int S[],int size){ if(size == 0) return 0; if(size == 1) return 1; if(S[0] != S[1]) return 1+foo(S+1,size-1); return foo(S+1,size-1); } int main(){ in...
Pointers, Arrays and Strings
Q.62
Let
LISTbe a datatype for an implementation of linked list defined as follows: typedef struct list { int data; struct list *next; } LIST; Suppose a program has created two li...Arrays and Linked Lists
Q.63
Consider the following C program: #include <stdio.h> int gate (int n) { int d, t, newnum, turn; newnum = turn = 0; t=1; while (n>=t) t *= 10; t /=10; while (t>0) { d = n/t; n =...
Data Types, Operators and Control Flow
Q.64
The maximum value of such that the edge between the nodes B and C is included in every minimum spanning tree of the given graph is _________ . (answer in integer) An undirec...
Minimum Spanning Trees
Q.65
In a double hashing scheme, and are the auxiliary hash functions. The size of the hash table is . The hash function for...
Hash Tables and Collision Resolution