GATE 2026 (Session 2) Computer Science and Information Technology (CS) Questions with Solutions

GATE 2026 (Session 2)

65 questions

MCQ 35 · MSQ 11 · NAT 191-mark 30 · 2-mark 35

Questions 51–55 of 65

Q51Process Synchronization2 marksMSQ
Consider three processes P1, P2\text{P1, P2}, and P3\text{P3} running identical code, as shown in the pseudocode below. A\text{A} and B\text{B} are two binary semaphores initialized to 11 and 00, respectively. X\text{X} is a shared variable initialized to 00. Each line in the pseudocode is executed atomically.

Pseudocode of P1, P2, and P3

  Wait(A);
  Print(*);
  X = X+1;
  If (X == 2)
  	{
  		Print($);
  		Signal(B);
  	}
  Signal(A);
  Wait(B);
  Print(#);
  Signal(B); 
Assume that any of the three processes can start to execute first and context switching can happen between these processes at any arbitrary time and in any arbitrary order.

Which of the following patterns is/are possible to be generated as an outcome of the execution of these three processes?

One or more options are correct.

Q52Cache Memory2 marksMSQ
Consider a system with a processor and a 44 KB direct mapped cache with block size of 1616 bytes. The system has a 1616 MB physical memory. Four words P,Q,R{P}, {Q}, {R}, and S are accessed by the processor in the same order 1010 times. That is, there are a total of 4040 memory references in the sequence P,Q,R,S,P,Q,R,S,…{P}, {Q}, {R}, {S}, {P}, {Q}, {R}, {S}, \ldots

Assume that the cache memory is initially empty. The physical addresses of the words are given below (11 word =1=1 byte).

P: 0x845B32, Q: 0x845B26, R: 0x845B36, S: 0x846B32\text{P: 0x845B32, Q: 0x845B26, R: 0x845B36, S: 0x846B32}

Which of the following statements is/are true?
Note: 1 K=2101 {~K}=2^{10} and 1M=2201 {M}=2^{20}

One or more options are correct.

Q53Secondary Storage2 marksNAT
To keep track of free blocks in a file system, one of the two approaches is generally used - using bitmaps (bit vectors) or using linked lists. Consider that the linked list approach is used to keep track of free blocks in a file system. Assume that the disk size is 1616 GB , block size is 22 KB , and block numbers used are 3232-bit long. A single pointer of size 44 bytes is used in each block of the list to point to the next block of the list. The number of blocks required to hold the free disk block numbers is ________. (answer in integer)
Note: 1K=2101 {K}=2^{10} and 1G=2301 {G}=2^{30}

Q54Memory Management2 marksNAT
A system has a Translation Lookaside Buffer (TLB) that has a reach of 11 MB. TLB reach is defined as the total amount of physical memory that can be accessed through the TLB entries. The paging system uses pages of size 44 KB. The virtual address space is 6464 GB and physical address space is 11 GB. If each TLB entry stores a 44-bit process id, page number, frame number, and a 22-bit control field, then the size of the TLB (in bytes) is ________. (answer in integer)
Note: 1K=210,1M=220,1G=2301 {K}=2^{10}, 1 {M}=2^{20}, 1 {G}=2^{30}

Q55Memory Management2 marksNAT
Consider contiguous allocation of physical memory to processes using variable partitioning scheme. Suppose there are 88 holes in the memory of sizes 20KB,4KB20 \text{KB}, 4 \text{KB}, 25KB,18KB,7KB,9KB,15KB25 \text{KB}, 18 \text{KB}, 7 \text{KB}, 9 \text{KB}, 15 \text{KB}, and 12KB12\text{KB}. Assume that no two holes are adjacent. Two processes P1\text{P1} of size 16KB16KB and P2\text{P2} of size 9KB9KB arrive in that order, and they are allocated memory using the best-fit technique. After allocating space to P1\text{P1} and P2\text{P2}, the number of holes of size less than 8KB8KB is ________. (answer in integer)
Note: 1K=2101 {K}=2^{10}