Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Tests  >  Test: Operating System - 2 - Computer Science Engineering (CSE) MCQ

Test: Operating System - 2 - Computer Science Engineering (CSE) MCQ


Test Description

15 Questions MCQ Test - Test: Operating System - 2

Test: Operating System - 2 for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Test: Operating System - 2 questions and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus.The Test: Operating System - 2 MCQs are made for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, notes, meanings, examples, exercises, MCQs and online tests for Test: Operating System - 2 below.
Solutions of Test: Operating System - 2 questions in English are available as part of our course for Computer Science Engineering (CSE) & Test: Operating System - 2 solutions in Hindi for Computer Science Engineering (CSE) course. Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free. Attempt Test: Operating System - 2 | 15 questions in 45 minutes | Mock test for Computer Science Engineering (CSE) preparation | Free important questions MCQ to study for Computer Science Engineering (CSE) Exam | Download free PDF with solutions
Test: Operating System - 2 - Question 1

The main function of the dispatcher (the portion of the process scheduler) is:

Detailed Solution for Test: Operating System - 2 - Question 1
  • Mid-term scheduler: swap the processes from the wait state to hard disk
  • Short-term scheduler: selects the processes that are ready to execute and allocates the CPU to one of them
  • Dispatcher: Context switches, in which the dispatcher saves the state of the previous process then the dispatcher loads the saved state of the new process selected by the short-term scheduler
  • Long-term scheduler: bring the processes to main memory from the hard disk
Test: Operating System - 2 - Question 2

Consider a system has hit ratio as h%. Average access time to service a page fault is s milliseconds and average effective memory access time is e in milliseconds. What is the memory access time in microseconds (m is considered with service time)?

Detailed Solution for Test: Operating System - 2 - Question 2

Service time = s milliseconds = 1000s microseconds

Hit ratio = h % = h ÷ 100

∴ miss ratio = p = (1 - h ÷ 100) (page fault rate)

EMAT = e millisecond = 1000e microseconds

If m is considered

EMAT = p × (s + m) + (1 - p) × m

EMAT = p × s + m

Substitute the values:

1000e = (1 – (h ÷ 100)) 1000s + m

∴ m = 1000 × e - 1000 × s + 10 × s × h

∴ m = 10 × (100 × (e - s) + s × h)

Important Points:
EMAT → effective memory access time

p → page fault rate

s → service time

m → memory access time

Confusion point:

m is very large, in this case m is ignored and not take with service time

EMAT = p × s + (1 - p) × m

If m is considered

EMAT = p × (s + m) + (1 - p) × m

EMAT = p × s + m

1 Crore+ students have signed up on EduRev. Have you? Download the App
Test: Operating System - 2 - Question 3

Suppose there is a paging system with a translation lookaside buffer. Assuming that the entire page table and all the pages are in the physical memory, what is the effective memory access time in ms if it takes 5 msec to search the TLB and 70 msec to access physical memory? The TLB hit ratio is 0.8.

Detailed Solution for Test: Operating System - 2 - Question 3

Data:

TLB hit ratio = p = 0.8

TLB access time = 5 milliseconds

Memory access time = m = 70 milliseconds

Formula:

EMAT = p × (t + m) + (1 – p) × (t + m + m)

Calculation:

EMAT = 0.8 × (5 + 70) + (1 – 0.8) × (5 + 70 + 70)

EMAT = 89 milliseconds.

Important points:

During TLB hit

The frame number is fetched from the TLB (5 ms)

and page is fetched from physical memory (70 ms)

During TLB miss

TLB no entry matches (5 ms)

The frame number is fetched from the physical memory (70 ms)

and pages are fetched from physical memory (70 ms)

Test: Operating System - 2 - Question 4

Which of the following statements are true?

(a) External Fragmentation exists when there is enough total memory space to satisfy a request but the available space is contiguous.

(b) Memory Fragmentation can be internal as well as external.

(c) One solution to external Fragmentation is compaction.

Detailed Solution for Test: Operating System - 2 - Question 4

(a) External Fragmentation exists when there is enough total memory space to satisfy a request but the available space is contiguous.

This statement is incorrect. As process are loaded and removed from memory, the free memory space is  broken into little pieces. External fragmentation exists when enough total memory space exists to satisfy a request but it is not contiguous; storage is fragmented into large number of small holes.  External fragmentation is also known as checker boarding. Suppose we have memory blocks available of size 400KB each. But if request come for 600Kb then it cannot be allocated.

(b) Memory Fragmentation can be internal as well as external.

This statement is correct. There is an important issue related to the contiguous multiple partition allocation scheme is to deal with memory fragmentation. There are two types of fragmentation: internal and external fragmentation. Internal fragmentation exists in the case of memory having multiple fixed partitions when the memory is allocated to a process is not fully used by the process.

(c) One solution to external Fragmentation is compaction.

Given statement is correct. To get rid of external fragmentation problem, it is desirable to relocated some or all portions of the memory in order to place all the free holes together at one end of memory to make one large hole. This technique of reforming the storage is known as compaction.

Test: Operating System - 2 - Question 5

Consider a computer system having R resources of the same type and these resources are shared by 6 processes that have maximum demands of 7, 5, 3, 8, 4, 6 respectively. Then for what minimum values of R, the system will not be in deadlock?

Detailed Solution for Test: Operating System - 2 - Question 5

Deadlock can occur If any process gets < needed (requested) resource

Max resource per process to be in deadlock = max demand – 1 

For 6 process, max resource to be in deadlock = (7 – 1) + (5 – 1) + (3 – 1) + (8 - 1) + (4 - 1) + (6 - 1) =27 

For 6 process, min resource not to be in a deadlock: 27 + 1 =28

Tips and Tricks:

where Pis the max resource needed by the ith process and n is the total number of process

Test: Operating System - 2 - Question 6

Which of the following statement is not true about round – robin scheduling?

Detailed Solution for Test: Operating System - 2 - Question 6

Concept:

The round – robin scheduling algorithm is designed for time sharing systems. It is similar to FCFS but preemption is added to enable the system to switch between processes.

Some points about round- robin scheduling :

  • To implement round robin, we keep the queue as a FIFO queue of processes.
  • Round robin scheduling is preemptive.
  • If there are n processes in the ready queue and the time quantum is q, then each process gets 1/n of the CPU time in chunks of at most q time units. Each process must wait no longer than (n-1) × q time units until its next time quantum.
  • Performance of the round robin algorithm depends on the size of time quantum.
  • If time quantum is too large, then round robin behaves like FCFS.
  • If time quantum is too small, then this approach is called processor sharing.
Test: Operating System - 2 - Question 7

Which of the following is TRUE about user-level threads and kernel-level threads?

S1: Typically if a user-level thread is performing blocking system call then the entire process will be blocked

S2: Kernel level threads are designed as dependent threads

S3: Every thread has its own register and stack

 

Detailed Solution for Test: Operating System - 2 - Question 7

S1: TRUE:

If a user-level thread block then entire process will get blocked

S2: FALSE

Kernel level threads are independent that is why they also require more context switch than user – level threads.

S3: TRUE

Every thread has its own register and stack

Therefore S1 and S3 are TRUE

Test: Operating System - 2 - Question 8

Which of the following statement is correct about cascading termination of a child process?

Detailed Solution for Test: Operating System - 2 - Question 8

Concept:

Fork system call is used to create a new process. Newly creates process is known as child process. Fork system call takes no arguments and return a process ID.

A process terminates when it finishes its final statement and asks the operating system to delete it by using the exit() system call. At that point, process may return a status value to its parent process. All the resources are deallocated by the operating system.

A parent may terminate the execution of one of its children for a variety of reasons such as :

  • Child has exceeded its usage of some of the resources that it has been allocated
  • The task assigned to the child is no longer required.
  • The parent has terminated and operating system does not allow a child to exist. This is known as cascading termination.
Test: Operating System - 2 - Question 9

Consider a hypothetical system with byte-addressable memory, 64-bit logical addresses, 8 Megabyte page size and page table entries of 16 bytes each. What is the size of the page table in the system in terabytes?

Detailed Solution for Test: Operating System - 2 - Question 9

Data

1 word (W) = 1 byte (B)

Logical address = 264 B

page size = 8 MB = 223 B

page table entry (PTE) = 16 B

Formula:

Page table size (PTS) = number of pages × PTE

Calculation:

number of pages = 264 / 223=241

Page table size (PTS) = number of pages × y

PTS = 241 × 16B=245B

∴ PTS = 32 TB

Important points

1 TB = 240 B

where B stands for byte

Test: Operating System - 2 - Question 10

Given the Burst Time (BT) of 4 processes P1, P2, P3, and P4 as BT(t1, t2, t3, t4) – (4, 8, 6, 7), smoothening factor(α) – 0.5, and T1 = 10, what will be the burst time of process P5 for shortest Job first scheduling, using the technique of exponential averaging?

Detailed Solution for Test: Operating System - 2 - Question 10

In case of exponential averaging, formula used is:

T’ = αt1 + (1 - α)T

Here processes are given as:

Here α = 0.5, T1 = 10

T2 = 0.5 × 4 + (1 – 0.5) × 10

= 2 + 5 = 7

T3 = 0.5 × 8 + 0.5 × 7

= 4 + 3.5 = 7.5

T4 = 0.5 × 6 + 0.5 × 7.5

= 3 + 3. 75 = 6.75

T5 = 0.5 × 7 + 0.5 × 6.75

= 3.5 + 3.375 = 6.875

Required burst time = 6.875 time units

Test: Operating System - 2 - Question 11

Suppose that jobs arrive according to the following schedule :                                                 

Now give the sequence of the processes as they gets share of CPU if the scheduler used is Shortest Remaining Time First.

Detailed Solution for Test: Operating System - 2 - Question 11

Concept:

Shortest remaining time next:  pre-emptive scheduling

In shortest remaining time next, when a process of less burst time(run time) arrives than in ready queue then context switch will happen.

Test: Operating System - 2 - Question 12

The probability that a process spends its time in performing I/O operations is 50%. In a multi programmed operating system environment, if there are 4 processes in memory at once, then the probability that all processes are waiting for I/O and the system utilization are respectively

Detailed Solution for Test: Operating System - 2 - Question 12

Concept:

If the probability of process spending its time in performing I/O operations is P.

Then probability that all processes goes for I/O is P*P*P……….*P for n processes i.e. Pn.

Hence, the probability of CPU utilization will be 1- pn.

Here, the probability that a process spends its time in performing I/O operations is 50% i.e. 0.5

Then probability that all processes are waiting for I/O = (0.5)4

The probability of CPU utilization = 1 – (0.5)n

Test: Operating System - 2 - Question 13

The process executes the code where x is an integer and x is initialized to 10

while(--x){

fork();

if(x == 2)

break;

}

The total number of child processes created is

Detailed Solution for Test: Operating System - 2 - Question 13

From the table it is clear that fork is called 8 times

Formula:

If n times fork is called the number of child processes created = 2n – 1

Calculation:

Since n = 8

number of child processes created = 28 - 1 = 255

Test: Operating System - 2 - Question 14

Mutual exclusion problem occurs

Detailed Solution for Test: Operating System - 2 - Question 14

Concept:

Mutual exclusion happens when two or more processes share the same resources but can not access the same resource at the same time. 

Mutual exclusion is a property of concurrency control, which is instituted for the purpose of preventing race conditions.

It is the requirement that one thread of execution never enters its critical section at the same time that another concurrent thread of execution enters its own critical section. This problem is resolved using different tools, e.g. semaphores.

Test: Operating System - 2 - Question 15

A system has 12 identical resources and Y processes competing for them. Each process can request at most 3 resources. Which one of the following values of Y could lead to a deadlock?

Detailed Solution for Test: Operating System - 2 - Question 15

Data:

Available identical Resources = R = 12

Max needs per process = 3

Concepts:

Deadlock can occur If any process gets available resource < needed (requested) resource

Max resource per process to be in deadlock = needed – 1 = 3 – 1 = 2

For Y process, max resource to be in deadlock = Y × 2 = 2Y

Condition for deadlock

2Y ≥ R

2Y ≥ 12

Y  ≥ 6

values of Y could lead to a deadlock is 6 and 7

Information about Test: Operating System - 2 Page
In this test you can find the Exam questions for Test: Operating System - 2 solved & explained in the simplest way possible. Besides giving Questions and answers for Test: Operating System - 2, EduRev gives you an ample number of Online tests for practice

Top Courses for Computer Science Engineering (CSE)

Download as PDF

Top Courses for Computer Science Engineering (CSE)