GATE 2025 CS (CS1) – Previous Year Questions with Solutions
All 65 questions of GATE 2025 CS (CS1) with answers and explanations. Read each question, then practise it by topic or as a full paper.
Practise this paper in The GATE Grind →
- Question 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…
- Question 2 – The CEO's decision to downsize the workforce was considered myopic because it sacrificed long-term stability to accommodate short-term gains. Select…
- Question 3 – The average marks obtained by a class in an examination were calculated as 30.8. However, while checking the marks entered, the teacher found that the…
- Question 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.…
- Question 5 – According to the map shown in the figure, which one of the following statements is correct? Note: The figure shown is representative.
- Question 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…
- Question 7 – In the diagram, the lines QR and ST are parallel to each other. The shortest distance between these two lines is half the shortest distance between…
- Question 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…
- Question 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…
- Question 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…
- Question 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…
- Question 12 – Which ONE of the following statements is FALSE regarding the symbol table?
- Question 13 – Which ONE of the following techniques used in compiler code optimization uses live variable analysis?
- Question 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…
- Question 15 – A schedule of three database transactions T 1, T 2, and T 3 is shown. R i(A) and W i(A) denote read and write of data item A by transaction T i, i =…
- Question 16 – Identify the ONE CORRECT matching between the OSI layers and their corresponding functionalities as shown. OSI Layers: (a) Network layer, (b)…
- Question 17 – g(.) is a function from A to B, f(.) is a function from B to C, and their composition defined as f(g(.)) is a mapping from A to C. If f(.) and f(g(.))…
- Question 18 – Let G be any undirected graph with positive edge weights, and T be a minimum spanning tree of G. For any two vertices, u and v, let d 1(u,v) and d…
- Question 19 – Consider the following context-free grammar G, where S, A, and B are the variables (non-terminals), a and b are the terminal symbols, S is the start…
- Question 20 – Consider the following recurrence relation: T(n) = 2T(n-1) + n2n for n > 0, T(0) = 1. Which ONE of the following options is CORRECT?
- Question 21 – Consider the following B+ tree with 5 nodes, in which a node can store at most 3 key values. The value 23 is now inserted in the B+ tree. Which of the…
- Question 22 – Consider the 3-way handshaking protocol for TCP connection establishment. Let the three packets exchanged during the connection establishment be…
- Question 23 – Consider the given system of linear equations for variables x and y, where k is a real-valued constant. Which of the following option(s) is/are…
- Question 24 – Let X 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…
- Question 25 – The number -6 can be represented as 1010 in 4-bit 2's complement representation. Which of the following is/are CORRECT 2's complement…
- Question 26 – Which of the following statement(s) is/are TRUE for any binary search tree (BST) having n distinct integers?
- Question 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…
- Question 28 – A regular language L is accepted by a non-deterministic finite automaton (NFA) with n states. Which of the following statement(s) is/are FALSE?
- Question 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…
- Question 30 – Let S be the set of all ternary strings defined over the alphabet \a,b,c\. Consider all strings in S that contain at least one occurrence of two…
- Question 31 – Consider the given function f(x). f(x) = cases ax + b & for x < 1 \\ x3 + x2 + 1 & for x 1 cases If the function is differentiable everywhere, the…
- Question 32 – A box contains 5 coins: 4 regular coins and 1 fake coin. When a regular coin is tossed, the probability P(head) = 0.5 and for a fake coin, P(head) =…
- Question 33 – The pseudocode of a function fun() is given below: Let A[0,...,29] be an array storing 30 distinct integers in descending order. The number of swap…
- Question 34 – The output of the given C program is . (Answer in integer)
- Question 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 T stores…
- Question 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…
- Question 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…
- Question 38 – A computer has two processors, M 1 and M 2. Four processes P 1, P 2, P 3, P 4 with CPU bursts of 20, 16, 25, and 10 milliseconds, respectively, arrive…
- Question 39 – Consider two relations describing teams and players in a sports league: - teams(tid, tname): tid, tname are team-id and team-name, respectively -…
- Question 40 – A packet with the destination IP address 145.36.109.70 arrives at a router whose routing table is shown. Which interface will the packet be forwarded…
- Question 41 – Let A be a 2 2 matrix as given. A = bmatrix 1 & 1 \\ 1 & -1 bmatrix What are the eigenvalues of the matrix A13 ?
- Question 42 – Consider the following four variable Boolean function in sum-of-product form F(b 3,b 2,b 1,b 0) = (0,2,4,8,10,11,12). where the value of the function…
- Question 43 – Let G(V,E) be an undirected and unweighted graph with 100 vertices. Let d(u,v) denote the number of edges in a shortest path between vertices u and v…
- Question 44 – Consider the following two languages over the alphabet \a,b\: L 1 = \ \a,b\+ AND \a,b\+ \ L 2 = \ \a\+ AND \a,b\+ \ Which ONE of the following…
- Question 45 – Consider the following two languages over the alphabet \a,b,c\, where m and n are natural numbers. L 1 = \am bm cm+n m,n 1\ L 2 = \am bn cm+n m,n 1\…
- Question 46 – Which of the following statement(s) is/are TRUE while computing First and Follow during top down parsing by a compiler?
- Question 47 – Consider a relational schema team(name, city, owner), with functional dependencies \name city,\ name owner\. The relation team is decomposed into two…
- Question 48 – Which of the following predicate logic formulae/formula is/are CORRECT representation(s) of the statement: "Everyone has exactly one mother"? The…
- Question 49 – A = \0,1,2,3,...\ is the set of non-negative integers. Let F be the set of functions from A to itself. For any two functions, f 1, f 2 F, we define (f…
- Question 50 – Consider the following deterministic finite automaton (DFA) defined over the alphabet, = \a,b\. Identify which of the following language(s) is/are…
- Question 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…
- Question 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)
- Question 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…
- Question 54 – In optimal page replacement algorithm, information about all future page references is available to the operating system (OS). A modification of the…
- Question 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…
- Question 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…
- Question 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…
- Question 58 – Consider a probability distribution given by the density function P(x). P(x) = cases Cx2, & for 1 x 4 \\ 0, & for x < 1 or x > 4 cases The probability…
- Question 59 – Consider a finite state machine (FSM) with one input X and one output f, represented by the given state transition table. The minimum number of states…
- Question 60 – Consider the given sequential circuit designed using D-Flip-flops. The circuit is initialized with some value (initial state). The number of distinct…
- Question 61 – The value printed by the given C program is . (Answer in integer)
- Question 62 – Let LIST be a datatype for an implementation of linked list defined as follows: Suppose a program has created two linked lists, L1 and L2, whose…
- Question 63 – Consider the following C program: The value printed by the given C program is . (Answer in integer)
- Question 64 – The maximum value of x such that the edge between the nodes B and C is included in every minimum spanning tree of the given graph is . (answer in…
- Question 65 – In a double hashing scheme, h 1(k) = k 11 and h 2(k) = 1 + (k 7) are the auxiliary hash functions. The size m of the hash table is 11. The hash…