GATE 2025 (Session 1) Computer Science and Information Technology (CS) Questions with Solutions

GATE 2025 (Session 1)

65 questions

MCQ 30 · MSQ 13 · NAT 221-mark 30 · 2-mark 35

Questions 51–55 of 65

Q51File Systems2 marksNAT
A disk of size 512M512M bytes is divided into blocks of 64K64K bytes. A file is stored in the disk using linked allocation. Each data block reserves 4 bytes to store the pointer to the next data block. The link part of the last data block contains a NULL pointer (also of 4 bytes). Suppose a file of 1M1M bytes needs to be stored in the disk. Assume, 1K=210,1M=2201K=2^{10}, 1M=2^{20}. The amount of space in bytes that will be wasted due to internal fragmentation is _________. (Answer in integer)

Q52Intermediate Code Generation2 marksNAT
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
1003: t1 = 10*i
1004: t2 = t1+j
1005: t3 = 8*t2
1006: t4 = t3-88
1007: a[t4] = 0.0
1008: j = j+1
1009: if j <= 10 goto 1003
1010: i = i+1
1011: if i <= 10 goto 1002
1012: i = 1
1013: t5 = i-1
1014: t6 = 88*t5
1015: a[t6] = 1.0
1016: i = i+1
1017: if i <= 10 goto 1013

Q53Cache Memory2 marksNAT
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. If the data is not found in L1 cache, it goes to L2 cache. If it fails to get the data from L2 cache, it goes to main memory, where the data is definitely available. Hit rates and access times of various memory units are shown in the figure. The average memory access time in nanoseconds (ns) is _________. (rounded off to two decimal places)
Processor L1 cache Hit rate=95%, Access time = 10 ns L2 cache Hit rate=85%, Access time (including L1 cache miss penalty) = 20 ns Main Memory Access time (including L1 and L2 cache miss penalty) = 200 ns

Q54Memory Management2 marksNAT
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 algorithm is as follows:
The OS correctly predicts only up to next 4 page references (including the current page) at the time of allocating a frame to a page.
A process accesses the pages in the following order of page numbers:

1, 3, 2, 4, 2, 3, 1, 2, 4, 3, 1, 4.

If the system has three memory frames that are initially empty, the number of page faults that will occur during execution of the process is _________. (Answer in integer)

Q55SQL2 marksNAT
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 an SQL query are given.
player
pidpnameage
1Jasprit31
2Atharva24
3Ishan26
4Axar30
coach
cidcname
101Ricky
102Mark
103Trevor
team
tidtnamecitycid
10MIMumbai102
20DCDelhi101
30PKMohali103
members
pidtid
110
230
310
420
SELECT MIN(P.age)
FROM player P
WHERE P.pid IN (
    SELECT M.pid
    FROM team T, coach C, members M
    WHERE C.cname = 'Mark'
         AND T.cid = C.cid
         AND M.tid = T.tid
    )

The value returned by the given SQL query is _________. (Answer in integer)