0% found this document useful (0 votes)
135 views3 pages

OS MCQ Important

The document contains 15 multiple choice questions that assess understanding of key concepts related to process scheduling and synchronization in operating systems and multi-threaded programming. Specifically, it covers scheduling algorithms like FCFS, SJN, priority scheduling and round robin, their properties and tradeoffs. It also covers concepts like race conditions, solutions like mutexes and semaphores, and ensuring exclusive access to shared resources in a multi-threaded context to prevent data corruption.

Uploaded by

modernedits1234
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
135 views3 pages

OS MCQ Important

The document contains 15 multiple choice questions that assess understanding of key concepts related to process scheduling and synchronization in operating systems and multi-threaded programming. Specifically, it covers scheduling algorithms like FCFS, SJN, priority scheduling and round robin, their properties and tradeoffs. It also covers concepts like race conditions, solutions like mutexes and semaphores, and ensuring exclusive access to shared resources in a multi-threaded context to prevent data corruption.

Uploaded by

modernedits1234
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

MCQs

1. What is process scheduling in an operating system?


A. Allocating memory to processes
B. Managing the execution order of processes
C. Allocating CPU time to processes
D. Managing file access by processes

2. Which scheduling algorithm aims to minimize the average waiting time for
processes?
A. First-Come-First-Serve (FCFS)
B. Shortest Job Next (SJN)
C. Round Robin (RR)
D. Priority Scheduling

3. In a preemptive scheduling algorithm, a higher priority process can interrupt the


execution of a lower priority process. Which algorithm is an example of preemptive
scheduling?
A. FCFS
B. Shortest Job Next
C. Priority Scheduling
D. Round Robin

4. The time taken by a process from the time of submission to the time of completion is
called:
A. Turnaround time
B. Waiting time
C. Execution time
D. Response time

5. What is the main drawback of the First-Come-First-Serve (FCFS) scheduling


algorithm?
A. It may lead to starvation
B. It doesn't utilize CPU time efficiently
C. It has high overhead
D. It requires complex prioritization rules

6. The Shortest Job Next (SJN) scheduling algorithm selects the process with the:
A. Longest execution time
B. Shortest execution time
C. Highest priority
D. Lowest priority

7. If a Round Robin scheduling algorithm is used with a time quantum of 20


milliseconds, and each process gets the same amount of CPU time, how long will it
take to complete the first process if it requires 60 milliseconds of CPU time?
A. 20 milliseconds
B. 40 milliseconds
C. 60 milliseconds
D. 80 milliseconds
8. Which scheduling algorithm allows processes with the same priority to execute in a
first-come-first-serve order?
A. FCFS
B. SJN
C. Priority Scheduling
D. Round Robin

9. In Priority Scheduling, how are the priorities of processes usually assigned?


A. In ascending order of arrival time
B. In descending order of burst time
C. In descending order of priority values
D. In ascending order of process IDs

10. A process that has completed execution and has exited is said to be in the:
A. Ready state
B. Running state
C. Blocked state
D. Terminated state

11. What is a race condition in computer science and programming?


A. A competition between software developers to write code faster.
B. A situation where multiple threads or processes access shared data concurrently,
leading to unexpected results.
C. A condition where code is executed sequentially, ensuring data consistency.
D. A situation where only one thread or process can access shared data.

12. Which of the following is a common consequence of a race condition?


A. Predictable and consistent program behavior.
B. Deadlock.
C. Data corruption or incorrect results.
D. Improved program performance.

13. To mitigate race conditions, which synchronization technique is commonly used to


ensure exclusive access to shared resources?
A. Multithreading
B. Lock-free programming
C. Mutex (Mutual Exclusion)
D. Thread pooling

14. Which of the following is NOT a potential solution to preventing race conditions?
A. Using semaphores or mutexes.
B. Employing multi-core processors.
C. Implementing thread-safe data structures.
D. Applying proper synchronization techniques.
15. In a multi-threaded program, when two threads simultaneously access and modify a
shared variable, what may be needed to prevent a race condition?
A. A faster processor.
B. Synchronization mechanisms like locks or semaphores.
C. A larger stack size for each thread.
D. Reordering the code execution sequence.

You might also like