CS/IT Gate Yearwise
CS/IT Gate 2025 (Set 2)
CS/IT Gate 2024 (Set 1)
CS/IT Gate 2024 (Set 2)
CS/IT Gate 2023
CS/IT Gate 2022
CS/IT Gate 2021 (Set 1)
CS/IT Gate 2021 (Set 2)
CS/IT Gate 2020
CS/IT Gate 2019
CS/IT Gate 2018
CS/IT Gate 2017 (Set 1)
CS/IT Gate 2017 (Set 2)
CS/IT Gate 2016 (Set 1)
CS/IT Gate 2016 (Set 2)
CS/IT Gate 2015 (Set 1)
CS/IT Gate 2015 (Set 2)
CS/IT Gate 2015 (Set 3)
CS/IT Gate 2014 (Set 1)
CS/IT Gate 2014 (Set 2)
CS/IT Gate 2014 (Set 3)
CS and IT Gate 2025 Set-2 Questions with Answer
Ques 53 GATE 2025 SET-2
Consider a demand paging system with three frames, and the following page reference string: 123454164513 2. The contents of the frames are as follows initially and after each reference (from left to right):

Which one or more of the following could be the page replacement policy/policies in use?
Ques 54 GATE 2025 SET-2
P={P1,P2,P3,P4} consists of all active processes in an operating system.
R={R1,R2,R3,R4} consists of single instances of distinct types of resources in the system.
The resource allocation graph has the following assignment and claim edges.
Assignment edges: R1→P1, R2→P2, R3→P3, R4→P4 (the assignment edge R1→P1 means resource R1 is assigned to process P1, and so on for others)
Claim edges: P1→R2, P2→R3, P3→R1, P2→R4, P4→R2 (the claim edge P1→R2 means process P1 is waiting for resource R2, and so on for others)
Which of the following statement(s) is/are CORRECT?
Ques 55 GATE 2025 SET-2
A computer system supports a logical address space of 232 bytes. It uses two-level hierarchical paging with a page size of 4096 bytes. A logical address is divided into a b-bit index to the outer page table, an offset within the page of the inner page table, and an offset within the desired page. Each entry of the inner page table uses eight bytes. All the pages in the system have the same size.
The value of b is ______ (Answer in integer)
Ques 56 GATE 2025 SET-2
Consider the following C program:

Correct answer:
Hello World!
Explanation:
The statement stringcopy(a, a + 2); copies the string from a + 2 (which points to Hello World! in the original array a) into a itself. Therefore, the updated string in a becomes Hello World! and printf("%s", a); outputs Hello World!.
Ques 57 GATE 2025 SET-2

Ques 58 GATE 2025 SET-2
Consider the following C program:

The program declares a few integer variables and assigns pointers to them.
Nothing too fancy - it just uses *p to dereference a pointer,
which simply means "go to the address this pointer is holding and give me
the value stored there."
The most important thing to notice here is the printf format
string. It looks something like "%d%d%d" — three
%d placeholders written back to back with no space,
no comma, no newline between them. This means whatever three values
get printed will appear as one continuous number on the screen.
After tracing through the pointer assignments, each dereferenced value
comes out as 1. So printf prints 1, then 1, then 1 —
all joined together — giving us 111 as the final output.
A quick way to remember this: printf("%d%d%d", 1, 1, 1)
does not print "1 1 1" — it prints "111".
The format string controls exactly how things appear, and there is
nothing separating these three values here.
The output of the program is 111
Ques 59 GATE 2025 SET-2
Consider the following C program:

The correct answer is 64, which is a classic result from a fork-based process creation problem.
Key concepts used:
fork() creates a new child process. The return value is:
0 → inside child process
>0 → inside parent process (returns child's PID)
<0 → fork failed
execlp() replaces the current process image with a new program. Once called successfully, the remaining code in that process is NOT executed.
wait() makes the parent process block until a child process terminates.
With n fork() calls (without exec), total processes = 2n
For the answer to be 64:
26 = 64, meaning 6 fork() calls are involved
OR the program prints a value computed as 64 through process arithmetic.
The output of the given C program = 64
Ques 60 GATE 2025 SET-2
Which ONE of the following languages is accepted by a deterministic pushdown automaton?
Correct Answer:
a) Any regular language.
A deterministic pushdown automaton (DPDA) can accept all regular languages, because it can simulate any deterministic finite automaton (DFA), which recognizes regular languages.
Regular languages are a strict subset of deterministic context-free languages, but not all context-free languages are accepted by a DPDA—some require non-determinism.
The languages accepted by a DPDA (called deterministic context-free languages, DCFLs) include all regular languages, but not all context-free, NPDA-accepted, or decidable languages.
Ques 61 GATE 2025 SET-2
Let G1, G2 be Context Free Grammars (CFGs) and R be a regular expression. For a grammar G, let L(G) denote the language generated by G.
Which ONE among the following questions is decidable?
Ques 62 GATE 2025 SET-2
Consider the two lists List I and List II given below:
List I
(i) Context free languages
(ii) Recursive languages
(iii) Regular languages
List II
(a) Closed under union
(b) Not closed under complementation
(c) Closed under intersection
For matching of items in List I with those in List II, which of the following option(s) is/are CORRECT?
Ques 63 GATE 2025 SET-2
Let Σ={a,b,c}. For x∈Σ*, and α∈Σ, let #α(x) denote the number of occurrences of a in x.
Which one or more of the following option(s) define(s) regular language(s)?
Ques 64 GATE 2025 SET-2
Let Σ={1,2,3,4}. For x∈Σ*, let prod(x) be the product of symbols in x modulo 7. We take prod(ε)=1, where ε is the null string.
For example, prod(124)=(1×2×4) mod 7=1.
Define L={x∈Σ*|prod(x)=2}
The number of states in a minimum state DFA for L is ______ (Answer in integer)
Total Unique Visitors