Operating Systems Exam Questions PDF

Summary

This document contains exam questions on operating systems, covering various concepts and topics. It includes examples of different types of operating systems.

Full Transcript

# Operating Systems ## Variant 1 1. **What is the primary role of an operating system?** * b) To act as a layer between applications and hardware 2. **Which of the following is a characteristic of a monolithic kernel?** * d) Both b and c 3. **In a microkernel design, where are most servic...

# Operating Systems ## Variant 1 1. **What is the primary role of an operating system?** * b) To act as a layer between applications and hardware 2. **Which of the following is a characteristic of a monolithic kernel?** * d) Both b and c 3. **In a microkernel design, where are most services implemented?** * c) In user space 4. **True or False:** User-level threads are faster to create and switch between than kernel-level threads because they are managed by the operating system kernel. * **Answer:** False 5. **What is one disadvantage of microkernel-based operating systems?** * c) Higher potential for performance loss due to inter-process communication (IPC) 6. **In pipelining, what is the main purpose of branch prediction?** * c) To reduce stalls caused by control hazards 7. **What is an example of a data hazard in instruction pipelining?** * c) An instruction trying to read a register that a previous instruction is writing to 8. **True or False:** Dynamic scheduling rearranges the order of instructions during runtime to avoid pipeline stalls. * **Answer:** True 9. **What does Tomasulo's algorithm use to resolve data hazards?** * b) Reservation stations and register renaming 10. **Which of the following is an advantage of instruction-level parallelism?** * b) Increased efficiency in executing loops and independent instructions 11. **Which component of the OS ensures processes do not interfere with each other's memory?** * b) The kernel 12. **What is the purpose of branch prediction in a CPU pipeline?** * b) To guess the direction of a branch and avoid pipeline stalls 13. **What type of pipeline hazard occurs when two instructions need the same hardware resource?** * b) Structural hazard 14. **Which scheduling algorithm dynamically reorders instructions during execution?** * c) Tomasulo's algorithm 15. **What does the term "instruction-level parallelism" refer to?** * b) Executing multiple instructions simultaneously within a single pipeline ## Variant 2 1. **What is the primary role of an operating system?** * b) To act as a layer between applications and hardware 2. **Which of the following is a characteristic of a monolithic kernel?** * d) Both b and c 3. **In a microkernel design, where are most services implemented?** * c) In user space 4. **True or False:** User-level threads are faster to create and switch between than kernel-level threads because they are managed by the operating system kernel. * **Answer:** False 5. **What is one disadvantage of microkernel-based operating systems?** * c) Higher potential for performance loss due to inter-process communication (IPC) 6. **What does the fork() system call do in an operating system?** * b) Creates a new process as a duplicate of the parent process 7. **What is a key difference between parent and child processes created using fork()?** * c) They execute the same code but have separate memory spaces 8. **Which of the following is true about multithreading?** * a) Threads in the same process share the same memory space 9. **True or False:** A process can have multiple threads, but a thread cannot create a process. * **Answer:** True 10. **Which component of the OS ensures processes do not interfere with each other's memory?** * b) The kernel 11. **What is the purpose of branch prediction in a CPU pipeline?** * b) To guess the direction of a branch and avoid pipeline stalls 12. **What type of pipeline hazard occurs when two instructions need the same hardware resource?** * b) Structural hazard 13. **Which scheduling algorithm dynamically reorders instructions during execution?** * c) Tomasulo's algorithm 14. **What does the term "instruction-level parallelism" refer to?** * b) Executing multiple instructions simultaneously within a single pipeline ## General Concepts 1. **What is an operating system, and what is its role in a computer system?** An operating system (OS) acts as a layer between applications and hardware. Its role is to manage system resources like processes, memory, files, and devices, ensuring efficient and secure interaction between software and hardware. 2. **Describe the monolithic kernel structure. What are its advantages and disadvantages?** A monolithic kernel combines all OS services into one large kernel running in a single address space. The advantages include: high performance due to fewer context switches. However, disadvantages include: difficulty in modifying or debugging, and a higher risk of failure affecting the entire system. 3. **What are the features of a DOS-like operating system structure?** DOS-like systems have no strict separation between applications and the OS, allowing direct access to hardware. The advantages of this are speed and simplicity. But disadvantages include: lack of protection and security. 4. **What capabilities does the microkernel structure provide?** The microkernel structure separates basic OS functions into a small kernel and implements other services in user space. This allows better extensibility, easier debugging, and modularity. However, it may incur performance loss due to frequent context switches. 5. **How is protection ensured within and across users in an operating system?** Protection is achieved through mechanisms like memory isolation, privilege levels, and controlled access to system resources, using hardware-enforced rules. 6. **What goals must developers consider to ensure flexibility and scalability of operating systems?** Developers focus on scalability (using hardware resources efficiently), flexibility (adapting to application needs), and responsiveness (handling external events quickly). 7. **Explain the difference between kernel-level and user-level threads.** Kernel-level threads are managed by the OS and provide better control and scheduling but have higher overhead. User-level threads are managed by applications, offering faster context switches but lack kernel-level features like preemption. 8. **What are the pros and cons of the microkernel structure compared to the monolithic structure?** Pros include: modularity, easier debugging, and greater reliability. Cons include: potential performance overhead from frequent inter-process communication (IPC). 9. **How is a separate process created using the fork() system call in UNIX?** The fork() system call duplicates the current process to create a new child process. Both parent and child processes continue executing from the same point but have separate memory spaces. 10. **What happens when the parent process waits for the child process to complete?** The parent process uses wait() to pause its execution until the child process finishes, ensuring proper synchronization.

Use Quizgecko on...
Browser
Browser