Os MCQ Unit1 Updated

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 10

Here are 10 unique MCQs covering various topics of Operating Systems, with

answers:

1. Which of the following is NOT a service provided by an operating


system?
 a) Program execution
 b) Error detection
 c) Data warehousing
 d) I/O operations
Answer: c) Data warehousing

2. What does the user interface of an operating system primarily allow?


 a) Direct access to hardware components
 b) Communication between user and system
 c) Compilation of programs
 d) Direct execution of binary machine code
Answer: b) Communication between user and system

3. Which type of system call is used to terminate a process?


 a) fork()
 b) wait()
 c) exit()
 d) read()
Answer: c) exit()

4. System services are provided by the operating system to:


 a) Execute programs without user intervention
 b) Manage database operations
 c) Facilitate communication between processes
 d) Allow direct hardware access
Answer: c) Facilitate communication between processes

5. Which of the following is a system call used for file manipulation?


 a) open()
 b) malloc()
 c) print()
 d) shutdown()
Answer: a) open()

6. A linker is primarily used to:


 a) Translate source code into machine code
 b) Combine object code into a single executable
 c) Execute programs on a CPU
 d) Manage I/O operations
Answer: b) Combine object code into a single executable

7. What is the primary function of a loader in an operating system?


 a) To load files from external drives
 b) To allocate memory for programs
 c) To load executable files into memory for execution
 d) To translate high-level language into machine language
Answer: c) To load executable files into memory for execution

8. Which of the following is a type of user interface provided by an


operating system?
 a) Command Line Interface (CLI)
 b) HTML Interface
 c) Script Engine Interface
 d) Media Player Interface
Answer: a) Command Line Interface (CLI)

9. Which of the following system calls is used for process control in an


operating system?
 a) shmget()
 b) exec()
 c) printf()
 d) malloc()
Answer: b) exec()
10. What is the main purpose of system services in an operating
system?
 a) To enable user programs to directly interact with the hardware
 b) To provide a layer of abstraction between user applications and the
hardware
 c) To compile user programs
 d) To format the hard drive
Answer: b) To provide a layer of abstraction between user applications
and the hardware

1. Which of the following defines a process?


A) A program in execution
B) A passive entity like a file
C) A memory management technique
D) A type of hardware
Answer: A) A program in execution

2. What is the primary function of a Process Control Block (PCB)?


A) Manages file I/O operations
B) Stores information about a process
C) Controls memory allocation
D) Controls CPU scheduling
Answer: B) Stores information about a process

3. Which state does a process enter when it is waiting for an I/O operation to
complete?
A) Ready
B) Waiting
C) Running
D) Terminated
Answer: B) Waiting

4. What is context switching in process management?


A) Switching from user mode to kernel mode
B) Saving and restoring the state of a process
C) Switching from one memory block to another
D) Changing scheduling algorithms
Answer: B) Saving and restoring the state of a process

5. In which state does a process use the CPU for execution?


A) Ready
B) Running
C) Waiting
D) New
Answer: B) Running

6. Which scheduling algorithm selects the process that arrives first?


A) First-Come, First-Served
B) Shortest Job First
C) Round Robin
D) Priority Scheduling
Answer: A) First-Come, First-Served

7. What is the goal of process scheduling in a multiprogramming environment?


A) Maximizing CPU idle time
B) Maximizing process throughput
C) Minimizing process execution
D) Minimizing memory usage
Answer: B) Maximizing process throughput

8. Which of the following is a preemptive scheduling algorithm?


A) Shortest Job First
B) Round Robin
C) First-Come, First-Served
D) Priority Scheduling (non-preemptive)
Answer: B) Round Robin

9. What is the turnaround time of a process?


A) The total time taken by a process from submission to completion
B) The time spent in the ready queue
C) The time spent waiting for I/O
D) The time spent executing instructions
Answer: A) The total time taken by a process from submission to completion

10. In Round Robin scheduling, if the time quantum is too small, the algorithm
will:
A) Act like First-Come, First-Served
B) Cause high context switching overhead
C) Cause low CPU utilization
D) Minimize response time
Answer: B) Cause high context switching overhead

11. Which of the following is the main objective of CPU scheduling?


A) Minimizing context switches
B) Maximizing CPU utilization
C) Reducing process memory usage
D) Minimizing process turnaround time
Answer: B) Maximizing CPU utilization

12. What is a process state transition from running to waiting called?


A) I/O Burst
B) Preemption
C) Process Swap
D) Blocking
Answer: D) Blocking

13. In a multiprocessor system, what is the benefit of load balancing in


scheduling?
A) Increases the number of context switches
B) Ensures an even distribution of work among processors
C) Lowers memory consumption
D) Improves process priority
Answer: B) Ensures an even distribution of work among processors

14. What is inter-process communication (IPC)?


A) The mechanism by which processes exchange data
B) The mechanism by which processes share the same PCB
C) The technique to switch between processes
D) A hardware interrupt signaling technique
Answer: A) The mechanism by which processes exchange data

15. Which of the following is an example of inter-process communication using


shared memory?
A) Using semaphores
B) Using a message queue
C) Using pipes
D) Processes sharing a common memory segment
Answer: D) Processes sharing a common memory segment

16. What is the purpose of synchronization in inter-process communication?


A) To allocate CPU time to each process
B) To avoid race conditions when processes share resources
C) To stop processes from terminating
D) To allocate memory efficiently
Answer: B) To avoid race conditions when processes share resources

17. Which of the following IPC methods allows two processes to send messages
to each other?
A) Shared Memory
B) Message Passing
C) Paging
D) Swapping
Answer: B) Message Passing

18. In message-passing IPC, what is the key characteristic?


A) No shared memory between processes
B) Processes must share memory
C) It only works for I/O-bound processes
D) Messages cannot be stored in queues
Answer: A) No shared memory between processes

19. What is a critical section in inter-process communication?


A) A section of code where processes access shared resources
B) The main program code executed by the OS
C) A memory segment allocated to one process
D) A function that executes I/O operations
Answer: A) A section of code where processes access shared resources

20. Which of the following is the purpose of a semaphore in IPC?


A) To signal process termination
B) To synchronize access to shared resources
C) To allocate memory to processes
D) To increase CPU utilization
Answer: B) To synchronize access to shared resources

1. Which of the following multithreading model maps many user threads to one
kernel thread?
A) Many-to-One
B) One-to-One
C) Many-to-Many
D) Two-Level Model
Answer: A) Many-to-One
2. In the One-to-One multithreading model, how are user threads mapped to
kernel threads?
A) One user thread maps to many kernel threads
B) One user thread maps to one kernel thread
C) Many user threads map to one kernel thread
D) Many user threads map to many kernel threads
Answer: B) One user thread maps to one kernel thread

3. What is a disadvantage of the Many-to-One multithreading model?


A) It uses too many kernel threads
B) A blocking call in one thread can block the entire process
C) It increases the overhead of context switching
D) It cannot support concurrency
Answer: B) A blocking call in one thread can block the entire process

4. Which multithreading model allows multiple user threads to be mapped to


multiple kernel threads?
A) Many-to-One
B) One-to-One
C) Many-to-Many
D) Single-to-Many
Answer: C) Many-to-Many

5. In the Two-Level Model, what can user-level threads do that kernel-level


threads cannot?
A) Make system calls
B) Be created faster and with less overhead
C) Execute in the kernel mode
D) Access hardware directly
Answer: B) Be created faster and with less overhead
6. In which multithreading model does the operating system create a separate
kernel thread for each user thread?
A) Many-to-One
B) One-to-One
C) Many-to-Many
D) Two-Level
Answer: B) One-to-One

7. What is a disadvantage of user-level threads?


A) They are slower to create than kernel-level threads
B) They require system calls for thread management
C) They cannot leverage multiprocessor systems efficiently
D) They can only be scheduled preemptively
Answer: C) They cannot leverage multiprocessor systems efficiently

8. What happens when a thread makes a blocking system call in a Many-to-One


multithreading model?
A) Only the calling thread is blocked
B) The entire process is blocked
C) The OS creates a new thread to handle it
D) The thread continues execution
Answer: B) The entire process is blocked

9. What is the primary purpose of thread affinity in thread scheduling?


A) To bind a thread to a specific processor
B) To allow a thread to change priority
C) To enable a thread to move across processors
D) To lower the overhead of thread creation
Answer: A) To bind a thread to a specific processor

10. In thread scheduling, what is the main difference between user-level and
kernel-level threads?
A) User-level threads are managed by the OS
B) Kernel-level threads have higher priority
C) User-level threads are managed without OS intervention
D) Kernel-level threads are slower to create and manage

Answer: C) User-level threads are managed without OS intervention

11.What is the primary purpose of system calls in an operating system?


A) To design GUI of Operating System B) To provide an interface for user-level
applications to access OS services
Answer: B)

C) To compile programs D) To encrypt data


12. In which state does a process wait for an event to occur?
A) Ready B) Running
C) Waiting D) New
Answer: C)

13. The model in which one user-level thread is mapped to many kernel level
threads is called ________.
A) Many to One model B) One to Many model
C) Many to Many model D) One to One model
Answer: B)

14. Which scheduling algorithm assigns a fixed time slice to each process?
A) First-Come, First-Served B) Shortest Job First
C) Round Robin D) Priority Scheduling
Answer: C)

You might also like