CS and IT GATE 2024 SET-2 Questions with Answer

Ques 14 Computer Science


Consider a process P running on a CPU. Which one or more of the following events will always trigger a context switch by the OS that results in process P moving to a non-running state (e.g., ready, blocked)?

A

P makes a blocking system call to read a block of data from the disk

B

P tries to access a page that is in the swap space, triggering a page fault

C

An interrupt is raised by the disk to deliver data requested by some other process

D

A timer interrupt is raised by the hardware



Ques 15 Computer Science


Which of the following file organizations is/are I/O efficient for the scan operation in DBMS?

A

Heap file

B

Clustered B+ tree index

C

Unclustered tree index

D

Unclustered hash index



Ques 16 Computer Science


Which of the following statements about the Two Phase Locking (2PL) protocol is/are TRUE?

A

2PL permits only serializable schedules

B

With 2PL, a transaction always locks the data item being read or written just before every operation and always releases the lock just after the operation

C

With 2PL, once a lock is released on any data item inside a transaction, no more locks on any data item can be obtained inside that transaction

D

A deadlock is possible with 2PL



Ques 17 Computer Science


Which of the following statements about IPv4 fragmentation is/are TRUE?

A

The fragmentation of an IP datagram is performed only at the source of the datagram

B

The fragmentation of an IP datagram is performed at any IP router which finds that the size of the datagram to be transmitted exceeds the MTU

C

The reassembly of fragments is performed only at the destination of the datagram

D

The reassembly of fragments is performed at all intermediate routers along the path from the source to the destination



Ques 18 Computer Science


Which of the following statements is/are FALSE?

A

An attribute grammar is a syntax-directed definition (SDD) in which the functions in the semantic rules have no side effects

B

The attributes in a L-attributed definition cannot always be evaluated in a depth-first order

C

Synthesized attributes can be evaluated by a bottom-up parser as the input is parsed

D

All L-attributed definitions based on an LR(1) grammar can be evaluated using a bottom-up parsing strategy



Ques 19 Computer Science


For a Boolean variable x, which of the following statements is/are FALSE?

A

x. 1 = x

B

x + x = x

C

x. x̅ = 0

D

x + x̅ = 1



Ques 20 Computer Science


An instruction format has the following structure:
Instruction Number: Opcode destination reg, source reg-1, source reg-2
Consider the following sequence of instructions to be executed in a pipelined processor:

Which of the following statements is/are TRUE?

A

There is a RAW dependency on R3 between I1 and I2

B

There is a WAR dependency on R3 between I1 and I3

C

There is a RAW dependency on R3 between I2 and I3

D

There is a WAW dependency on R3 between I3 and I4



Ques 21 Computer Science


Which of the following fields of an IP header is/are always modified by any router before it forwards the IP packet?

A

Source IP Address

B

Protocol

C

Time to Live (TTL)

D

Header Checksum



Ques 22 Computer Science


Consider the following C function definition.

Which of the following statements is/are TRUE?

A

Assuming a character array c is declared as char c = "abcd" in main(), the function call fX(c) will always return a value

B

Assuming a character array c is declared as char c = "abcd" in main(), the function call fX("abcd") will always return a value

C

The code of the function will not compile

D

Assuming a character pointer c is declared as char *c = "abcd" in main(), the function call fX(c) will always return a value



Ques 23 Computer Science


Let P be the partial order defined on the set {1,2,3,4} as follows
P = {(x,x) | x ∈ {1,2,3,4}} ∪ {(1,2), (3,2), (3,4)}
The number of total orders on {1,2,3,4} that contain P is


3 is the correct answer.


Ques 24 Computer Science


Let A be an array containing integer values. The distance of A is defined as the minimum number of elements in A that must be replaced with another integer so that the resulting array is sorted in non-decreasing order. The distance of the array is ___________.


3 is the correct answer.


Ques 25 Computer Science


What is the output of the following C program?

A

4,8

B

1,5

C

8,5

D

1,8



Ques 26 Computer Science


Consider a single processor system with four processes A, B, C, and D, represented as given below, where for each process the first value is its arrival time, and the second value is its CPU burst time.
A(0,10), B(2,6), C(4,3), and D(6,7).
Which one of the following options gives the average waiting times when preemptive Shortest Remaining Time First (SRTF) and Non-Preemptive Shortest Job First (NP-SJF) CPU scheduling algorithms are applied to the processes?

A

SRTF = 6, NP-SJF = 7

B

SRTF = 6, NP-SJF = 7.5

C

SRTF = 7, NP-SJF = 7.5

D

SRTF = 7, NP-SJF = 8.5



Unique Visitor Count

Total Unique Visitors

Loading......