All mock tests are FREE till 31 December — register to save your progress
Paper 2 CS · UNIT 05 · MOCK TEST

System Software and Operating System — Mock Test 7

25 questions · about 30 minutes. Press End Mock any time to see your score and the correct answers.

0 / 25 answered 00:00
Q1. Which of the following statements are CORRECT?
(A) A process always checks the state of the currently executing process to enter the critical section.
(B) Spin locks use busy waiting.
(C) Periodically testing a variable until some value appears is known as busy waiting.
(D) A critical region is the part of the program where shared memory is accessed.
(E) The printer daemon continuously checks to see if there are any files to be printed.
Choose the correct answer from the options given below:
Q2. Match List I with List II
List IList II
(a) LRU(I) A page is written to secondary memory only when it has been selected for replacement
(b) Demand cleaning(II) A page that has not been referenced for the longest time is replaced
(c) Long-term scheduling(III) The decision to add to the number of processes that are partially or fully in main memory
(d) Medium-term scheduling(IV) The decision to add to the pool of processes to be executed
Q3. Arrange the following levels of interrupt protection within the Linux kernel in order of increasing priority.
(a) User-mode programs
(b) Bottom-half interrupt handlers
(c) Kernel system service routines
(d) Top-half interrupt handlers
Choose the correct answer from the options given below:
Q4. Statement (I): A thread is a dispatchable unit of work that does not execute sequentially and is not interruptible.
Statement (II): It is not possible to alter the behaviour of a thread by altering its context when the thread is suspended.
In the light of the above statements, choose the most appropriate answer from the options given below:
Q5. Given below are two statements: one is labelled as Assertion A and the other is labelled as Reason R.
Assertion A: I/O protection is ensured by a hardware trap.
Reason R: I/O interrupts are caused by conditions like I/O completion and device malfunction occurring within the I/O devices.
Q6. Consider the following statements:
S1: The LRU page-replacement algorithm suffers from Belady's anomaly.
S2: Shortest-remaining-time-first scheduling may cause starvation.
S3: The stack is shared by all threads in a process.
Q7. Given below are two statements: one is labelled as Assertion A and the other is labelled as Reason R.
Assertion A: A process invokes a library function to create a thread.
Reason R: Threads make system calls to convey their resource and I/O requirements to the kernel.
Q8. With respect to virtual memory:
Statement I: Address translation is performed for every logical address used during the execution of a program.
Statement II: A program can execute only when all of its components are loaded in memory.
Q9. A virtual memory system uses the first-in first-out page replacement policy and allocates a fixed number of frames to a process.
Assertion A: Increasing the number of page frames allocated to a process sometimes increases the page fault rate.
Reason R: Some programs do not exhibit locality of reference.
Q10. Consider the following arrival and burst times for three processes P0, P1, P2. The pre-emptive shortest job first algorithm is used, and scheduling is carried out only at the arrival or completion of a process. What is the average waiting time for the three processes?
ProcessArrival timeBurst time
P00 ms7
P11 ms3
P22 ms7
Q11. Match List I with List II
List IList II
A. RAID level 2I. Bit interleaved parity
B. RAID level 4II. Block interleaved distributed parity
C. RAID level 5III. Error correcting parity
D. RAID level 3IV. Block interleaved parity
Q12. Match List I with List II
List IList II
A. Critical regionI. Hoare's monitor
B. Wait/signalII. Mutual exclusion
C. Working setIII. Principle of locality
D. DeadlockIV. Circular wait
Q13. At a particular time of computation, the value of a counting semaphore is 7. Then 20 P operations and x V operations were completed on this semaphore. If the final value of the semaphore is 5, x will be
Q14. Requests to access cylinders occur in the sequence 4, 34, 10, 7, 19, 73, 2, 15, 6, 20. The head is currently at cylinder 50, and it takes 1 ms to move between adjacent cylinders. What is the time taken to satisfy all requests with the shortest-seek-time-first policy?

Directions (Q91–95): Consider the following program fragment that deals with a table T with 17 rows and 1024 columns, computing an average for each column and printing it (i is the row index and j is the column index):

for j = [0...1023] {
  temp = 0;
  for i = [0...16]
    temp = temp + T[i][j];
  print(temp / 17.0);
}

T[i][j] and temp are 32-bit floating-point values and memory is word addressable. temp is kept in a processor register, so accessing temp does not involve a memory reference. The main memory is paged and holds 16 pages of 1024 words each. The page replacement policy is least recently used (LRU). Unless stated otherwise, T is stored in the virtual address space in row-major format.

Q15. Consider now that T is stored in column-major format. What is the main memory hit ratio?

Directions (Q91–95): Consider the following program fragment that deals with a table T with 17 rows and 1024 columns, computing an average for each column and printing it (i is the row index and j is the column index):

for j = [0...1023] {
  temp = 0;
  for i = [0...16]
    temp = temp + T[i][j];
  print(temp / 17.0);
}

T[i][j] and temp are 32-bit floating-point values and memory is word addressable. temp is kept in a processor register, so accessing temp does not involve a memory reference. The main memory is paged and holds 16 pages of 1024 words each. The page replacement policy is least recently used (LRU). Unless stated otherwise, T is stored in the virtual address space in row-major format.

Q16. Consider that T is stored in column-major format. How many page faults will be encountered?

Directions (Q91–95): Consider the following program fragment that deals with a table T with 17 rows and 1024 columns, computing an average for each column and printing it (i is the row index and j is the column index):

for j = [0...1023] {
  temp = 0;
  for i = [0...16]
    temp = temp + T[i][j];
  print(temp / 17.0);
}

T[i][j] and temp are 32-bit floating-point values and memory is word addressable. temp is kept in a processor register, so accessing temp does not involve a memory reference. The main memory is paged and holds 16 pages of 1024 words each. The page replacement policy is least recently used (LRU). Unless stated otherwise, T is stored in the virtual address space in row-major format.

Q17. With T stored in row-major format, how many page faults will be encountered?

Directions (Q91–95): Consider the following program fragment that deals with a table T with 17 rows and 1024 columns, computing an average for each column and printing it (i is the row index and j is the column index):

for j = [0...1023] {
  temp = 0;
  for i = [0...16]
    temp = temp + T[i][j];
  print(temp / 17.0);
}

T[i][j] and temp are 32-bit floating-point values and memory is word addressable. temp is kept in a processor register, so accessing temp does not involve a memory reference. The main memory is paged and holds 16 pages of 1024 words each. The page replacement policy is least recently used (LRU). Unless stated otherwise, T is stored in the virtual address space in row-major format.

Q18. What is the ratio of page faults for the row-major to the column-major arrangement?

Directions (Q91–95): Consider the following program fragment that deals with a table T with 17 rows and 1024 columns, computing an average for each column and printing it (i is the row index and j is the column index):

for j = [0...1023] {
  temp = 0;
  for i = [0...16]
    temp = temp + T[i][j];
  print(temp / 17.0);
}

T[i][j] and temp are 32-bit floating-point values and memory is word addressable. temp is kept in a processor register, so accessing temp does not involve a memory reference. The main memory is paged and holds 16 pages of 1024 words each. The page replacement policy is least recently used (LRU). Unless stated otherwise, T is stored in the virtual address space in row-major format.

Q19. With T stored in row-major format, what is the main memory hit ratio?
Q20. The order of steps of address translation in the Linux virtual memory scheme will be:
A. Register
B. Offset
C. Page directory
D. Page table
E. Page middle directory
Choose the correct answer from the options given below:
Q21. The sequence of steps for a page-replacement algorithm will be:
A. Find a frame that is not currently being used
B. Change the page table
C. Use the freed frame
D. No frame is free
E. Free a frame
Choose the correct answer from the options given below:
Q22. Which of the following control problems does NOT exist when processes are unaware of each other during interaction?
Q23. Match List I with List II
List IList II
A. Batch MultiprogrammingI. Allows more efficient use of main memory
B. Time sharingII. User no longer has direct access to the processor
C. MonitorIII. Maximize processor use
D. Reentrant ProceduresIV. Minimize response time
Q24. Match List I with List II
List IList II
A. RAID level-2I. Block-interleaved
B. RAID level-3II. Error-correcting-code
C. RAID level-4III. Reed-Solomon codes
D. RAID level-6IV. Bit-interleaved
Q25. Match List I with List II (thread operations)
List IList II
A. Thread spawnI. To convert a blocking system call into a non-blocking call
B. Block threadII. To reclaim pages
C. JacketingIII. Processor turns to the execution of another ready thread
D. FlushIV. Thread is provided with its own register context