Unit 1 - Practice Quiz

CSE316 60 Questions
0 Correct 0 Wrong 60 Left
0/60

1 What is the primary purpose of an Operating System (OS)?

Operating System Meaning Easy
A. To secure the computer from internet viruses.
B. To provide software for word processing and spreadsheet calculations.
C. To act as an interface between the user/application and the computer hardware.
D. To translate high-level programming languages into machine code.

2 In which CPU mode are privileged instructions, such as I/O operations, executed?

Supervisor & User Mode Easy
A. Supervisor Mode
B. User Mode
C. Application Mode
D. Safe Mode

3 Which of the following is a core function of an operating system?

functions of OS Easy
A. Database Management
B. Video Editing
C. Memory Management
D. Web Browsing

4 What is the definition of a 'process' in the context of an operating system?

Process concept Easy
A. A hardware component like the CPU.
B. A set of programming instructions.
C. A file stored on the hard disk.
D. A program in execution.

5 A process that is ready to run but is waiting for the CPU to become available is in which state?

Process states Easy
A. Running
B. Ready
C. New
D. Waiting

6 What is a Process Control Block (PCB)?

Process Management: PCB Easy
A. A data structure that stores all information about a process.
B. A user-facing control panel for applications.
C. A block of code that starts the operating system.
D. A hardware block that controls processes.

7 What is the main objective of multiprogramming?

Types of Operating System: Multiprogramming and Multiprocessing System Easy
A. To allow users to write programs more easily.
B. To maximize CPU utilization by keeping several jobs in memory.
C. To run programs on multiple processors simultaneously.
D. To process jobs one at a time in a batch.

8 How does a user-level program request a service from the operating system kernel?

system calls Easy
A. By directly accessing hardware.
B. By using a system call.
C. By modifying kernel code.
D. By sending an email to the administrator.

9 In UNIX-like systems, the creation of a new process is commonly achieved using which operation?

Operations on Processes Easy
A. The fork operation
B. The block operation
C. The terminate operation
D. The execute operation

10 A multitasking operating system is also often referred to as a:

Types of Operating System: Multitasking Easy
A. Single-tasking system
B. Batch processing system
C. Time-sharing system
D. Real-time system

11 A process that cannot affect or be affected by other processes executing in the system is known as a(n):

Co-operating and Independent Processes Easy
A. Child process
B. Parent process
C. Co-operating process
D. Independent process

12 Which type of operating system is essential for applications where tasks must be completed within a specific time frame, such as in a car's airbag deployment system?

Types of Operating System: RTOS etc. Easy
A. Batch Operating System
B. Multitasking Operating System
C. Distributed Operating System
D. Real-Time Operating System (RTOS)

13 Which of the following was one of the earliest types of operating systems, where jobs with similar needs were grouped together and run sequentially?

evolution of OSs Easy
A. Multitasking Systems
B. Distributed Systems
C. Real-Time Systems
D. Simple Batch Systems

14 What is the final state of a process after it has finished execution and its resources have been reclaimed?

Life cycle Easy
A. Ready
B. Waiting
C. Terminated
D. New

15 What is the central component of an operating system that manages the system's resources and directly interacts with the hardware?

OS structure Easy
A. The File System
B. The Shell
C. The Kernel
D. The Application Programming Interface (API)

16 An attempt by a program in User Mode to execute a privileged instruction will typically cause a:

Supervisor & User Mode Easy
A. Program to speed up
B. Trap to the operating system
C. New file to be created
D. System shutdown

17 When a running process needs to wait for an I/O operation to complete, it transitions to which state?

Process states Easy
A. Waiting
B. Ready
C. Terminated
D. New

18 An operating system that manages a collection of independent computers and makes them appear to the user as a single computer is a(n):

Types of Operating System: Distributed Easy
A. Real-Time OS
B. Embedded OS
C. Distributed OS
D. Batch OS

19 The part of the OS that is responsible for managing, creating, and deleting files and directories is called the:

functions of OS Easy
A. Process Manager
B. Memory Manager
C. File System
D. Scheduler

20 A system with two or more CPUs that share memory and peripherals is called a:

Types of Operating System: Multiprogramming and Multiprocessing System Easy
A. Batch System
B. Multiprogramming System
C. Multiprocessing System
D. Time-sharing System

21 A user process attempts to execute an instruction to directly disable all hardware interrupts. What is the most likely outcome in a modern, protected operating system?

Supervisor & User Mode Medium
A. The instruction executes successfully, but only for the interrupts related to that specific process.
B. The CPU ignores the instruction completely as it is unrecognized in user mode.
C. The operating system promotes the process to supervisor mode temporarily to allow the instruction to complete.
D. The instruction causes a trap to the kernel, which will terminate the process for attempting a privileged operation.

22 An application needs to read data from a file. Why does it use a system call like read() instead of directly accessing the disk controller's hardware registers?

System calls Medium
A. To ensure system integrity and security, preventing the user program from bypassing file permissions or corrupting the file system.
B. Because direct hardware access is significantly slower than making a system call.
C. Because high-level languages like Python or Java do not have the capability to generate instructions for direct hardware access.
D. To allow the operating system to cache the file in user-space memory for faster subsequent access.

23 What is the key difference between a multiprogramming operating system and a multiprocessing operating system?

Types of Operating System: Multiprogramming and Multiprocessing System Medium
A. Multiprogramming can only run processes from a single user, while multiprocessing supports multiple users.
B. Multiprogramming uses a single Process Control Block (PCB) for all jobs, while multiprocessing uses one per job.
C. Multiprogramming achieves concurrency on a single CPU, while multiprocessing achieves true parallelism with multiple CPUs.
D. Multiprogramming requires user interaction, while multiprocessing is only used for batch jobs.

24 A process in a preemptive multitasking system is moved from the Running state to the Ready state. Which of the following events is the most probable cause?

Process states Medium
A. A timer interrupt occurred, indicating the process's time slice has expired.
B. The process has completed its execution and is releasing its resources.
C. The process has requested an I/O operation and is waiting for it to complete.
D. A higher-priority process has just completed its I/O and is now ready to run.

25 During a context switch from Process A to Process B, what is the critical role of the Process Control Blocks (PCBs)?

Process Management: PCB Medium
A. PCB A is moved from the 'ready queue' to the 'running queue'.
B. The state of Process A (e.g., Program Counter, CPU registers) is saved into PCB A, and the state from PCB B is loaded into the CPU.
C. The memory addresses in PCB B are updated to point to Process A's memory.
D. PCB A is copied to create PCB B.

26 For a safety-critical automotive braking system, which type of operating system is most appropriate and why?

Types of Operating System: Distributed and RTOS etc. Medium
A. A Batch OS, because braking is a single, non-interactive task.
B. A Multitasking OS, because it provides a responsive user experience for the driver.
C. A Distributed OS, because it can coordinate with other car systems.
D. A Hard Real-Time OS (RTOS), because it guarantees that braking calculations will complete within a strict, deterministic deadline.

27 A key advantage of a microkernel OS structure compared to a monolithic kernel structure is that...

OS structure Medium
A. It requires less memory overhead due to the large size of the kernel.
B. It is easier to write and debug because all system code is located in one large block.
C. It is more reliable, as a failure in a non-essential service (e.g., a device driver) running in user space does not cause the entire kernel to crash.
D. Communication between components is faster because it all happens within a single address space.

28 A web server creates several processes to handle incoming requests. These processes need to access and update a shared counter that tracks the total number of visitors. This makes them:

Co-operating and Independent Processes Medium
A. Co-operating processes, because they share data and their execution can affect one another.
B. Zombie processes, because they are waiting for the parent to collect their status.
C. Independent processes, because each one handles a different client request.
D. Parent processes, because they all originate from the main server process.

29 In a UNIX-like system, what is the typical sequence of system calls to create a new process that runs a different program (e.g., launching a shell command)?

Operations on Processes Medium
A. fork() followed by exec() in the child process.
B. A single create_process() call that specifies the new program to run.
C. wait() followed by fork().
D. exec() followed by fork() in the parent process.

30 The primary goal of a multitasking (or time-sharing) operating system, which is an extension of multiprogramming, is to:

Types of Operating System: Multitasking Medium
A. Minimize user-perceived response time and provide interactivity.
B. Ensure that critical tasks are always completed before their deadlines.
C. Maximize the number of jobs completed per hour (throughput).
D. Allow a single program to use multiple CPUs simultaneously.

31 Which state transition is impossible in a standard process life cycle model?

Process Life Cycle Medium
A. Running -> Ready
B. Waiting -> Running
C. Ready -> Waiting
D. Running -> Waiting

32 A system call is executed by a process. Which of the following describes the mode transitions that occur?

Supervisor & User Mode Medium
A. The process transitions from Supervisor Mode to User Mode to execute the call.
B. The entire system, including all other processes, switches to Supervisor Mode until the call is complete.
C. The process stays in User Mode, but the OS grants it temporary privileges.
D. The process transitions from User Mode to Supervisor Mode, the OS performs the service, and then it transitions back to User Mode.

33 In a tightly-coupled parallel system (multiprocessor), multiple processors share access to a common main memory and system clock. What is a primary challenge in designing the OS for such a system?

Types of Operating System: Parallel Medium
A. Managing separate memory address spaces for each processor.
B. Dealing with high network latency between processors.
C. Ensuring that if one processor fails, the entire system can continue operating seamlessly.
D. Ensuring proper synchronization to prevent multiple processors from corrupting shared data structures in memory.

34 A program requires more memory than is physically available in RAM. The OS uses a portion of the hard disk to simulate additional RAM. This scenario is a direct application of which core OS function?

Functions of OS Medium
A. File Management.
B. Memory Management (specifically, virtual memory).
C. Process Management.
D. Security and Protection.

35 What is the difference between a program and a process?

Process concept Medium
A. A single program can only ever correspond to a single process.
B. A program is a passive entity (e.g., code on disk), while a process is an active instance of a program being executed.
C. A program is written in a high-level language, while a process is machine code.
D. A process is stored in non-volatile memory, while a program is in RAM.

36 When comparing the parameter passing methods for system calls, why might passing parameters via registers be more efficient than passing them via a block of memory?

System calls Medium
A. It allows for an unlimited number of parameters to be passed.
B. It doesn't require the CPU to switch to supervisor mode.
C. It avoids the overhead of memory read/write operations for the parameters themselves.
D. It is more secure because user programs cannot access registers.

37 A primary reason for the low CPU utilization in a simple batch system was the significant speed mismatch between the CPU and which other component?

Types of Operating System: Simple Batch Systems Medium
A. The arithmetic logic unit (ALU).
B. The system clock.
C. I/O devices like tape drives and card readers.
D. Main memory (RAM).

38 The evolution from single-user systems to multiprogramming systems was primarily driven by the need to:

Evolution of OSs Medium
A. Support networking between computers.
B. Improve system security and process isolation.
C. Provide a graphical user interface (GUI).
D. Increase CPU utilization and overall system throughput.

39 A process transitions from the Waiting state to the Ready state. What event must have occurred?

Process states Medium
A. The I/O operation or event the process was waiting for has completed.
B. The process's time slice has expired.
C. The scheduler has selected this process to run on the CPU.
D. The process was just created by the operating system.

40 In a monolithic kernel architecture, how is communication between different components, such as the file system and a device driver, typically handled?

OS structure Medium
A. Through system calls that transition from one kernel component to another.
B. Through direct function calls within the same kernel address space.
C. Through shared memory segments monitored by the CPU.
D. Through a message-passing mechanism between user-level processes.

41 A process running in user mode attempts to execute a CLD (Clear Direction Flag) instruction, which is a non-privileged instruction, but immediately after, it attempts to execute a CLI (Clear Interrupt Flag) instruction, which is privileged. What is the most probable sequence of events that follows?

Supervisor & User Mode Hard
A. The OS, through preemptive checks, identifies the upcoming privileged instruction and terminates the process before either instruction executes.
B. The CPU executes the CLD, but the CLI instruction is converted into a no-op (no operation) because the process is in user mode, allowing it to continue execution.
C. The CPU executes the CLD, then generates a general protection fault/trap for the CLI attempt. The OS trap handler is invoked and likely terminates the process.
D. The CPU ignores both instructions as the sequence is deemed invalid, and the process continues with a warning flag set in the Process Status Word.

42 In a hard real-time operating system (RTOS), a high-priority task T_H becomes ready while a lower-priority task T_L is executing within a critical section protected by a mutex. The system uses a preemptive, priority-based scheduler with a priority inheritance protocol. What happens immediately after T_H becomes ready?

Types of Operating System: RTOS etc. Hard
A. T_H waits, and T_L continues execution. A medium-priority task T_M cannot preempt T_L even if T_M has higher priority than T_L.
B. T_H waits, and T_L continues execution, but if a medium-priority task T_M becomes ready, it will preempt T_L, prolonging T_H's wait.
C. T_L is immediately preempted, and T_H starts executing, potentially leading to deadlock if T_H needs the same mutex.
D. The system crashes due to a priority inversion violation.

43 A process is currently in the Ready-Suspended state in a system that supports swapping. Which sequence of events is required for this process to transition to the Running state?

Process states Hard
A. The process voluntarily yields the CPU, is loaded into main memory, and then waits for its turn.
B. An I/O event completes, and the scheduler dispatches the process.
C. The process is loaded into main memory by the swapper, and then dispatched by the short-term scheduler.
D. The scheduler dispatches the process, which triggers a page fault to bring it into memory.

44 In comparing a microkernel OS to a monolithic kernel OS, which statement best analyzes the performance implications of inter-process communication (IPC)?

OS structure Hard
A. IPC is faster in a microkernel because it is a fundamental, highly optimized primitive, whereas it is an add-on feature in monolithic kernels.
B. IPC performance is identical in both architectures because it is ultimately limited by the speed of the underlying hardware.
C. IPC overhead is a major performance bottleneck in microkernels because services like file systems or device drivers run as user-space processes, requiring frequent context switches and message passing through the kernel for communication.
D. IPC in monolithic kernels is slower and less secure because it requires traversing the entire OS layer stack for each communication request.

45 A user-level multithreaded application on a Linux system uses the fork() system call from one of its threads. What is the most accurate and common outcome according to POSIX standards?

System calls Hard
A. Only the thread that called fork() is duplicated. The child process is single-threaded.
B. The fork() call fails with an error because it's not thread-safe.
C. The entire parent process, including all of its threads, is duplicated in the child process.
D. A new child process is created, but it starts in a suspended state until all threads from the parent are individually copied.

46 A system has 4 CPU cores and the degree of multiprogramming is fixed at 8. All processes are identical and spend 25% of their time in CPU execution and 75% waiting for I/O. Assuming the I/O operations of processes can be overlapped, what is the approximate CPU utilization?

Multiprogramming and Multiprocessing System Hard
A. 100%, because with 8 processes, there are always enough ready processes for the 4 cores.
B. ~68.4%, calculated as for a single CPU, then adjusted.
C. ~87.0%, calculated as .
D. 25%, because each process is only 25% CPU-bound.

47 A multiprocessing system has 4 CPU cores and its degree of multiprogramming is set to 10. Each process in the system spends 60% of its time waiting for I/O and 40% of its time on CPU computation. Assuming a process's need for CPU is independent of other processes, what is the most accurate characterization of the system's resource utilization?

Multiprogramming and Multiprocessing System Hard
A. CPU utilization is approximately 40%, matching the CPU-bound percentage of each process.
B. The system is severely I/O-bound as each process waits for I/O 60% of the time.
C. The system is CPU-bound as the number of cores is insufficient for the number of processes.
D. The system is perfectly balanced, with CPU utilization approaching 100%.

48 During a context switch away from Process A to Process B on a preemptive system, which information in Process A's Process Control Block (PCB) is typically updated by the OS kernel after the context is saved but before the switch to Process B is complete?

Process Management: PCB Hard
A. The program counter.
B. The memory management registers (base/limit).
C. The general-purpose CPU registers.
D. The process state (e.g., from Running to Ready).

49 Two co-operating processes, a Producer and a Consumer, share a bounded buffer of size N. The Producer must block if the buffer is full, and the Consumer must block if it's empty. If the operating system only provides binary semaphores (mutexes, which can only be 0 or 1) as a synchronization primitive, how can counting semaphores (empty and full) be correctly emulated to manage the buffer slots?

Co-operating and Independent Processes Hard
A. By using one mutex for buffer access, another mutex to count full slots, and a third mutex to count empty slots, with processes busy-waiting on the count mutexes.
B. By using a mutex for buffer access, shared integer variables for the counts, and a separate binary semaphore for each process (e.g., prod_block, cons_block) on which it can wait after discovering the buffer is full/empty.
C. It is impossible; counting semaphores are fundamentally different and cannot be emulated with only binary semaphores.
D. By using a shared integer for the count, protected by a mutex. A process needing to wait would lock the mutex, check the count, and if it needs to block, it would unlock and re-lock in a busy-wait loop.

50 The development of time-sharing (multitasking) operating systems in the 1960s was a significant evolution from multiprogrammed batch systems. What key hardware feature was most critical for enabling this transition to be efficient and secure?

Evolution of OSs Hard
A. Direct Memory Access (DMA) controllers for efficient I/O.
B. The ability of the CPU to perform floating-point arithmetic.
C. The introduction of magnetic tape storage.
D. A hardware timer that could generate periodic interrupts.

51 In a distributed system built on the microkernel architecture (e.g., Mach), a process on Machine A sends a message to a process on Machine B. Which statement provides the most accurate, low-level description of this communication?

Types of OS: Distributed etc. Hard
A. The processes establish a direct network socket between them, bypassing both operating systems for maximum performance.
B. The kernel on Machine A sends the message directly to the process on Machine B using a special hardware link.
C. The process on Machine A writes the message to a distributed shared memory segment that is instantaneously replicated on Machine B.
D. The sending process makes a local IPC call to its kernel (Kernel A). Kernel A forwards the message over the network to Kernel B, which then delivers it to the destination process via local IPC.

52 A parent process P creates a child C using fork(). C immediately terminates by calling exit(). The parent process P, however, is stuck in an infinite compute-bound loop and never calls wait(). What is the state of process C, and what is its primary impact on the system?

Operations on Processes Hard
A. C is an orphan process; it is adopted by init and its resources are fully reclaimed.
B. C is a zombie process; its PCB is kept in the process table to hold its exit status, consuming a process table slot until the parent (or a reaper) collects it.
C. C is terminated and all its resources, including the PCB, are immediately reclaimed by the OS, having no impact.
D. C becomes a daemon process, running in the background until the system reboots.

53 In a system with a 32-bit virtual address space, the top 1GB is reserved for the kernel. A process consists of multiple threads. Where are the kernel stacks for these threads located?

Process concept Hard
A. Each thread gets its own kernel stack, located within the kernel's reserved address space.
B. Kernel stacks are allocated on-demand from the user-space stack of each thread.
C. Within the heap of the user-space process.
D. All threads within a process share a single kernel stack, located in the kernel's data segment.

54 An OS uses a Memory Management Unit (MMU) with paging for memory protection. A user process attempts a write operation to a memory address that belongs to a page marked as read-only in its page table. What is the most precise sequence of events?

Functions of OS Hard
A. The process receives a SIGSEGV signal from the OS after the write completes but fails verification.
B. The write operation succeeds, but the OS's journaling system will roll back the change upon the next system call.
C. The MMU hardware blocks the write, generates a page fault trap, and sets a specific error code bit indicating a protection violation.
D. The OS's context switch routine periodically checks for invalid memory writes and terminates the process if one is found.

55 An exokernel is a type of operating system structure. What is its fundamental design philosophy, and how does it differ from a microkernel?

OS structure Hard
A. An exokernel runs the entire operating system in user space, with the hardware itself managing protection, distinguishing it from a microkernel's privileged core.
B. An exokernel's goal is to securely multiplex the hardware with minimal abstraction, allowing application-level libraries to implement traditional OS services like file systems and scheduling.
C. An exokernel provides high-level abstractions like file systems and processes, but allows applications to replace them, unlike a microkernel which has fixed abstractions.
D. An exokernel is a monolithic kernel that can be extended via loadable modules, whereas a microkernel is statically compiled.

56 Consider a system with a preemptive scheduler and two processes, P1 (high priority) and P2 (low priority). P2 is running and has acquired a lock L. P1 becomes ready and preempts P2. P1 then attempts to acquire lock L and blocks. P2 is now on the ready queue but cannot run because P1 is a higher priority process (even though P1 is blocked). This situation is best described as:

Process states Hard
A. A standard deadlock.
B. Priority inversion.
C. Starvation of P2.
D. A race condition.

57 Modern operating systems like Linux have introduced mechanisms like vDSO (virtual Dynamic Shared Object). What fundamental problem associated with traditional system calls does this mechanism aim to solve for specific calls like gettimeofday()?

System calls Hard
A. The inability of user processes to directly access hardware devices like the system clock.
B. The lack of a standardized API for common functions.
C. The security risk of allowing user code to enter the kernel.
D. The performance overhead of the trap and context switch required for a full system call, for very frequent, read-only operations.

58 In the context of a preemptive multitasking OS, what is the 'convoy effect', and which scheduling algorithm is most susceptible to it?

Multitasking Hard
A. A situation where high-priority processes get blocked by low-priority ones, common in Priority-based scheduling.
B. The tendency for processes of similar length to group together in the ready queue, which degrades performance in Round-Robin scheduling.
C. The overhead of the scheduler itself becomes a bottleneck as the number of processes increases, a problem in all algorithms.
D. When many I/O-bound processes get stuck waiting behind a single long-running CPU-bound process, a known issue with the First-Come, First-Served (FCFS) algorithm.

59 A process P1 creates a child P2 using fork(). P2 then immediately executes exec() to run a new program. Which of the following is inherited by P2 from P1 across the fork() and is also guaranteed to be preserved across the exec()?

Process Life cycle Hard
A. The parent process ID (PPID).
B. The mapping of signal handlers.
C. The heap contents.
D. The memory layout of the stack.

60 In a Symmetric Multiprocessing (SMP) system, what is the primary purpose of a cache coherence protocol like MESI (Modified, Exclusive, Shared, Invalid)?

Types of Operating System: Parallel Hard
A. To ensure that the CPU scheduler distributes processes evenly across all cores.
B. To synchronize access to I/O devices from different cores.
C. To manage the virtual memory page tables for all cores.
D. To ensure that all CPU cores have a consistent view of the data in main memory, by managing the state of shared data in their private caches.