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 translate high-level programming languages into machine code.
B. To provide software for word processing and spreadsheet calculations.
C. To secure the computer from internet viruses.
D. To act as an interface between the user/application and the computer hardware.

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

Supervisor & User Mode Easy
A. User Mode
B. Supervisor 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. Web Browsing
B. Video Editing
C. Database Management
D. Memory Management

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. New
B. Running
C. Ready
D. Waiting

6 What is a Process Control Block (PCB)?

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

7 What is the main objective of multiprogramming?

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

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

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

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

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

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

Types of Operating System: Multitasking Easy
A. Batch processing system
B. Time-sharing system
C. Real-time system
D. Single-tasking 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. Independent process
B. Child process
C. Co-operating process
D. Parent 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. Real-Time Systems
B. Multitasking Systems
C. Simple Batch Systems
D. Distributed 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. Waiting
B. Ready
C. New
D. Terminated

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 Kernel
B. The File System
C. The Application Programming Interface (API)
D. The Shell

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

Supervisor & User Mode Easy
A. Trap to the operating system
B. New file to be created
C. Program to speed up
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. Ready
B. Waiting
C. New
D. Terminated

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. Batch OS
C. Embedded OS
D. Distributed 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. File System
C. Memory Manager
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. Time-sharing System
B. Multiprocessing System
C. Multiprogramming System
D. Batch 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 instruction causes a trap to the kernel, which will terminate the process for attempting a privileged operation.
C. The CPU ignores the instruction completely as it is unrecognized in user mode.
D. The operating system promotes the process to supervisor mode temporarily to allow the instruction to complete.

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 allow the operating system to cache the file in user-space memory for faster subsequent access.
B. Because direct hardware access is significantly slower than making a system call.
C. To ensure system integrity and security, preventing the user program from bypassing file permissions or corrupting the file system.
D. Because high-level languages like Python or Java do not have the capability to generate instructions for direct hardware 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 requires user interaction, while multiprocessing is only used for batch jobs.
C. Multiprogramming achieves concurrency on a single CPU, while multiprocessing achieves true parallelism with multiple CPUs.
D. Multiprogramming uses a single Process Control Block (PCB) for all jobs, while multiprocessing uses one per job.

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

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. The memory addresses in PCB B are updated to point to Process A's memory.
B. PCB A is copied to create PCB B.
C. PCB A is moved from the 'ready queue' to the 'running queue'.
D. 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.

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 Hard Real-Time OS (RTOS), because it guarantees that braking calculations will complete within a strict, deterministic deadline.
B. A Multitasking OS, because it provides a responsive user experience for the driver.
C. A Batch OS, because braking is a single, non-interactive task.
D. A Distributed OS, because it can coordinate with other car systems.

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. Communication between components is faster because it all happens within a single address space.
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. It is easier to write and debug because all system code is located in one large block.

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. Zombie processes, because they are waiting for the parent to collect their status.
B. Independent processes, because each one handles a different client request.
C. Co-operating processes, because they share data and their execution can affect one another.
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. exec() followed by fork() in the parent process.
B. A single create_process() call that specifies the new program to run.
C. fork() followed by exec() in the child process.
D. wait() followed by fork().

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. Maximize the number of jobs completed per hour (throughput).
B. Ensure that critical tasks are always completed before their deadlines.
C. Minimize user-perceived response time and provide interactivity.
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 -> Waiting
B. Waiting -> Running
C. Running -> Ready
D. Ready -> 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 User Mode to Supervisor Mode, the OS performs the service, and then it transitions back to User Mode.
B. The process transitions from Supervisor Mode to User Mode to execute the call.
C. The entire system, including all other processes, switches to Supervisor Mode until the call is complete.
D. The process stays in User Mode, but the OS grants it temporary privileges.

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. Ensuring that if one processor fails, the entire system can continue operating seamlessly.
B. Ensuring proper synchronization to prevent multiple processors from corrupting shared data structures in memory.
C. Dealing with high network latency between processors.
D. Managing separate memory address spaces for each processor.

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. Security and Protection.
B. Process Management.
C. Memory Management (specifically, virtual memory).
D. File Management.

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

Process concept Medium
A. A process is stored in non-volatile memory, while a program is in RAM.
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 single program can only ever correspond to a single process.
D. A program is written in a high-level language, while a process is machine code.

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 avoids the overhead of memory read/write operations for the parameters themselves.
B. It allows for an unlimited number of parameters to be passed.
C. It doesn't require the CPU to switch to supervisor mode.
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. I/O devices like tape drives and card readers.
B. The arithmetic logic unit (ALU).
C. Main memory (RAM).
D. The system clock.

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

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

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

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

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 shared memory segments monitored by the CPU.
B. Through direct function calls within the same kernel address space.
C. Through a message-passing mechanism between user-level processes.
D. Through system calls that transition from one kernel component to another.

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 CPU ignores both instructions as the sequence is deemed invalid, and the process continues with a warning flag set in the Process Status Word.
B. 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.
C. The OS, through preemptive checks, identifies the upcoming privileged instruction and terminates the process before either instruction executes.
D. 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.

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. The system crashes due to a priority inversion violation.
C. T_L is immediately preempted, and T_H starts executing, potentially leading to deadlock if T_H needs the same mutex.
D. 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.

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 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.
C. IPC in monolithic kernels is slower and less secure because it requires traversing the entire OS layer stack for each communication request.
D. IPC performance is identical in both architectures because it is ultimately limited by the speed of the underlying hardware.

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

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. 25%, because each process is only 25% CPU-bound.
B. ~87.0%, calculated as .
C. ~68.4%, calculated as for a single CPU, then adjusted.
D. 100%, because with 8 processes, there are always enough ready processes for the 4 cores.

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 perfectly balanced, with CPU utilization approaching 100%.
C. The system is CPU-bound as the number of cores is insufficient for the number of processes.
D. The system is severely I/O-bound as each process waits for I/O 60% of the time.

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 general-purpose CPU registers.
B. The memory management registers (base/limit).
C. The process state (e.g., from Running to Ready).
D. The program counter.

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 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.
B. It is impossible; counting semaphores are fundamentally different and cannot be emulated with only binary semaphores.
C. 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.
D. 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.

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. The ability of the CPU to perform floating-point arithmetic.
B. A hardware timer that could generate periodic interrupts.
C. Direct Memory Access (DMA) controllers for efficient I/O.
D. The introduction of magnetic tape storage.

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 process on Machine A writes the message to a distributed shared memory segment that is instantaneously replicated on Machine B.
B. The kernel on Machine A sends the message directly to the process on Machine B using a special hardware link.
C. The processes establish a direct network socket between them, bypassing both operating systems for maximum performance.
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 terminated and all its resources, including the PCB, are immediately reclaimed by the OS, having no impact.
B. C becomes a daemon process, running in the background until the system reboots.
C. 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.
D. C is an orphan process; it is adopted by init and its resources are fully reclaimed.

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. Within the heap of the user-space process.
B. Kernel stacks are allocated on-demand from the user-space stack of each thread.
C. All threads within a process share a single kernel stack, located in the kernel's data segment.
D. Each thread gets its own kernel stack, located within the kernel's reserved address space.

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 write operation succeeds, but the OS's journaling system will roll back the change upon the next system call.
B. The MMU hardware blocks the write, generates a page fault trap, and sets a specific error code bit indicating a protection violation.
C. The process receives a SIGSEGV signal from the OS after the write completes but fails verification.
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'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.
B. An exokernel is a monolithic kernel that can be extended via loadable modules, whereas a microkernel is statically compiled.
C. An exokernel runs the entire operating system in user space, with the hardware itself managing protection, distinguishing it from a microkernel's privileged core.
D. An exokernel provides high-level abstractions like file systems and processes, but allows applications to replace them, unlike a microkernel which has fixed abstractions.

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. Priority inversion.
B. Starvation of P2.
C. A standard deadlock.
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 security risk of allowing user code to enter the kernel.
B. The lack of a standardized API for common functions.
C. The inability of user processes to directly access hardware devices like the system clock.
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. 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.
D. The overhead of the scheduler itself becomes a bottleneck as the number of processes increases, a problem in all algorithms.

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 mapping of signal handlers.
B. The heap contents.
C. The memory layout of the stack.
D. The parent process ID (PPID).

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 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.
C. To manage the virtual memory page tables for all cores.
D. To synchronize access to I/O devices from different cores.