You are on page 1of 13

NIELIT NIC 2020

Q1. A process executes the code


fork();
fork();
fork();
The total number of child processes created is

(a) 3
(b) 4
(c) 7
(d) 8
Q2. A process executes the following code
for (i = 0; i < n; i++)
fork();
The total number of child processes created is

(a) n
(b) 2n -1
(c) 2n
(d) 2(n+1) -1
Q3. Which one of the following is FALSE?
(a) User level threads are not scheduled by the kernel
(b) When a user level thread is blocked, all other threads of its process are blocked
(c) Context switching between user level threads is faster than context switching between kernel level threads
(d) Kernel level threads cannot share the code segment
Q4. Which of the following need not necessarily be saved on a context switch between processes?
(a) General purpose registers
(b) Translation look aside buffer
(c) Program counter
(d) All of the above
Q5. Consider a non-negative counting semaphore S. The operation P(S) decrements S, and V(S) increments S.
During an execution, 20 P(S) operations and 12 V(S) operations are issued in some order. The largest
initial value of S for which at least one P(S) operation will remain blocked is ________.

(a) 7
(b) 8
(c) 9
(d) 10
Q6. The following are some events that occur after a device controller issues an interrupt while process L is
under execution.
(P) The processor pushes the process status of L onto the control stack.
(Q) The processor finishes the execution of the current instruction.
(R) The processor executes the interrupt service routine.
(S) The processor pops the process status of L from the control stack.
(T) The processor loads the new PC value based on the interrupt.
Which of the following is the correct order in the which the events above occur?
(a) QPTRS
(b) PTRSQ
(c) TRPQS
(d) QTPRS
Q.7 A FAT (file allocation table) based file system is being used and the total overhead of each entry in the
FAT is 4 bytes in size. Given a 100 x 106 bytes disk on which the file system is stored and data block size is
103 bytes, the maximum size of a file that can be stored on this disk in units of 10 6 bytes is ____________

A 99.55 to 99.65
B 100.5 to 101.4
C 97.2 to 98.5
D 89.1 to 91.2
Q8. What is the output of the following program?
main ( )
{
int a = 10;
if ((fork ( ) == 0))
a++;
printf (“%dn”, a);
}

(a) 10 and 11
(b) 10
(c) 11
(d) 11 and 11
Q9. In __________ allocation method for disk block allocation in a file system, External fragmentation is
possible.
A Index
B Linked
C Contiguous
D Bit Map
Q10. #include <stdio.h>
#include <unistd.h>
int main()
{
if (fork() || fork())
fork();
printf("Hello");
return 0;
}
If we execute this core segment, how many times the string ‘Hello’ will be printed?

(a) 3 times
(b) 4 times
(c) 5 times
(d) 8 times
Q11. Match the following:
List - I List - II
(a) Spooling (i) Allows several jobs in memory to improve CPU utilization
(b) Multiprogramming (ii) Access to shared resources among geographically dispersed computers in a
transparent way
(c) Time sharing (iii) Overlapping I/O and computations
(d) Distributed computing (iv) Allows many users to share a computer simultaneously by switching
processor frequently

Codes:
(a) (b) (c) (d)
(1) (iii) (i) (ii) (iv)
(2) (iii) (i) (iv) (ii)
(3) (iv) (iii) (ii) (i)
(4) (ii) (iii) (iv) (i)

(a) (1)
(b) (2)
(c) (3)
(d) (4)
Q12. Dining Philosopher's problem is a:
(a) Producer - consumer problem
(b) Classical IPC problem
(c) Starvation problem
(d) Synchronization primitive
Solutions:
1) C
2) B
3) D
4) B
5) A
6) A
7) A
8) A
9) C
10) C
11) B
12) B

You might also like