U.G.C. NET Exam. 24 June, 2019 Paper–II (COMPUTER SCIENCE & APPLICATIONS)

Total Questions: 100

41. Consider a disk system with 100 cylinders. The requests to access the cylinders occur in the following sequence :

4, 34, 10, 7, 19, 73, 2, 15, 6, 20
Assuming that the head is currently at cylinder 50, what is the time taken to satisfy all requests if it takes 1ms to move from the cylinder to adjacent one and the shortest seek time first policy is used?

Correct Answer: (d) 119 ms
Solution:

= (50 – 34) + (34 – 20) + (20 – 19) + (19 – 15) + ( 15 – 10) + (10 – 7) + ( 7 – 6) + (6 – 4) + (4 – 2) + (73 – 2) = 16 + 14 + 1 + 4 + 5 + 3 + 1 + 2 + 2 + 71 = 119 ms

42. Match List-I with List-II

Correct Answer: (b) (A)-(iii), (B)-(i), (C)-(iv), (D)-(ii)
Solution:

43. Consider that a process has been allocated 3 frames and has a sequence of page referencing as 1, 2, 1, 3, 7, 4, 5, 6, 3, 1.

What shall be the difference in page faults for the above string using the algorithms of LRU and optimal page replacement for referencing the string?

Correct Answer: (a) 2
Solution:

44. Which of the following are Not shared by the threads of the same process?

(A) Stack
(B) Registers
(C) Address space
(D) Message queue

Correct Answer: (c) (A) and (B)
Solution:

"In general each thread has its own registers (including its own program counter), its own stack pointer, and its own stack. Everything else is shared between the threads sharing a process, why register cannot be shared? Each thread needs its own program counter value (which is a register) why stack cannot be shared? Each thread may have its own calling sequence. So stack and registers is correct

45. Consider three CPU intensive processes, which require 10, 20 and 30 units of time and arrive at times 0, 2 and 6 respectively. How many context switches are needed if the operating system implements a shortest remaining time first scheduling algorithim? Do not count the context switches at time zero and the end.

Correct Answer: (b) 2
Solution:

Let three process be P0, P1 and P2 with arrival times 0, 2 and 6 respectively and CPU burst times 10, 20 and 30 respectively. At time 0, P0 is the only available process so it runs. At time 2, P1 arrives, but P0 has the shortest remaining time, So it continues At time 6, P2 arrives, but P0 has the shortest remaining time process. At time 30, P2 is scheduled. Only two context switches are needed. P0 to P1 and P1 to P2. Processes executes as per the following Gantt chart

46. At a particular time of computation, the value of a counting semaphore is 7. Then 20 P (wait) operations and 15V (signal) operations are completed on this semaphore. What is the resulting value of the semaphore?

Correct Answer: (c) 2
Solution:

I → P represent wait and v represent signal. P operation will decrease the value by 1 every time and Y operation will increase the value by 1 every time. Value of counting semaphore = 7 After 20 P operations value of semaphore = 7 – 20
= –13
After 15 v operations value of semaphore
= –13 + 15 = 2

47. The minimum number of page frames that must be allocated to a running process in a virtual memory environment is determined by

Correct Answer: (c) the instruction set architecture
Solution:

There are two important task in virtual memory management : a page replacement strategy and a frame-allocation strategy. Frame allocation strategy say gives the idea of minimum number of frames that a process must be allocated is dependent on system architecture, and corresponds to the number of pages that could be touched by a single (machine) instruction. So the instruction set architecture is right answer.

48. A computer has six tape drives with n processes competing for them. Each process may need two drives. What is the maximum value of n for the system to be deadlock free?

Correct Answer: (a) 5
Solution:

Given tape drive = 6 and each process may need 2 drive.
When we give 1 drive to 1 process then total process will be 6 but in this case there will definitely deadlock occur because every process contain 1 drive and waiting for another drive which is hold by other process therefore when we reduce 1 process then system to be deadlock free.
Hence maximum value of n = 6 – 1 = 5

49. A processor can support a maximum memory of 4 GB where memory is word addressable and a word is 2 bytes. What will be the size of the address bus of the processor?

Correct Answer: (c) At least 31 bits
Solution:

50. Which of the following UNIX/Linux pipes will count the number of lines in all the file having c and h as their extension in the current working directory?

Correct Answer: (d) cat*[ch]|wc–1
Solution:

Pipes in Linux/Unix : Pipe is a command which produces an output which serves as input for next command. It works as a pipeline structure in computer.
Explanation : We have to find the number of lines in all the files having .c and .h as their extension in the current working directory.
WC- in Unix/Linux, "WC" is used for word count. Cat- it is used to display the content of the files. Option 4- Cat * .[ch] //it represent the content of files having .c and .h extension
Option 2 →
Cat * [c -h]/ WC-L //it also includes the files with c and .h extension but it also considers the other extensions that come between because it is a range which is not required in this question. So cat * [ch]/WC-L
It will count the number of Lines in all the files having .c and .h as their extension in current working directory.