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

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. Memory Management
C. Database Management
D. Video Editing

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 program in execution.
C. A set of programming instructions.
D. A file stored on the hard disk.

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 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 maximize CPU utilization by keeping several jobs in memory.
B. To process jobs one at a time in a batch.
C. To run programs on multiple processors simultaneously.
D. To allow users to write programs more easily.

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

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

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

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

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

Types of Operating System: Multitasking Easy
A. Time-sharing system
B. Single-tasking system
C. Real-time system
D. Batch processing 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. Co-operating process
B. Child process
C. Independent 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. Real-Time Operating System (RTOS)
B. Distributed Operating System
C. Multitasking Operating System
D. Batch Operating System

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. Distributed Systems
B. Multitasking Systems
C. Simple Batch Systems
D. Real-Time 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. 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 Application Programming Interface (API)
B. The File System
C. The Kernel
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. System shutdown
B. Program to speed up
C. Trap to the operating system
D. New file to be created

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. New
C. Waiting
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. Batch OS
B. Real-Time 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. Memory Manager
B. Scheduler
C. Process Manager
D. File System

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. Multiprogramming System
C. Multiprocessing 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 operating system promotes the process to supervisor mode temporarily to allow the instruction to complete.
C. The CPU ignores the instruction completely as it is unrecognized in user mode.
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 allow the operating system to cache the file in user-space memory for faster subsequent access.
B. To ensure system integrity and security, preventing the user program from bypassing file permissions or corrupting the file system.
C. Because high-level languages like Python or Java do not have the capability to generate instructions for direct hardware access.
D. Because direct hardware access is significantly slower than making a system call.

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. A higher-priority process has just completed its I/O and is now ready to run.
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 timer interrupt occurred, indicating the process's time slice has expired.

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

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 Batch OS, because braking is a single, non-interactive task.
C. A Distributed OS, because it can coordinate with other car systems.
D. A Multitasking OS, because it provides a responsive user experience for the driver.

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

OS structure Medium
A. It is easier to write and debug because all system code is located in one large block.
B. 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.
C. Communication between components is faster because it all happens within a single address space.
D. It requires less memory overhead due to the large size of the kernel.

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

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. Ensure that critical tasks are always completed before their deadlines.
B. Maximize the number of jobs completed per hour (throughput).
C. Allow a single program to use multiple CPUs simultaneously.
D. Minimize user-perceived response time and provide interactivity.

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

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

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 process stays in User Mode, but the OS grants it temporary privileges.
D. The entire system, including all other processes, switches to Supervisor Mode until the call is complete.

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

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

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

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

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. Main memory (RAM).
B. The system clock.
C. I/O devices like tape drives and card readers.
D. The arithmetic logic unit (ALU).

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

Evolution of OSs Medium
A. Provide a graphical user interface (GUI).
B. Improve system security and process isolation.
C. Support networking between computers.
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 process's time slice has expired.
B. The scheduler has selected this process to run on the CPU.
C. The process was just created by the operating system.
D. The I/O operation or event the process was waiting for has completed.

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 direct function calls within the same kernel address space.
B. Through shared memory segments monitored by the CPU.
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. The system crashes due to a priority inversion violation.
B. 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.
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. The scheduler dispatches the process, which triggers a page fault to bring it into memory.
C. The process is loaded into main memory by the swapper, and then dispatched by the short-term scheduler.
D. An I/O event completes, and the scheduler dispatches the process.

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

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

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. ~68.4%, calculated as for a single CPU, then adjusted.
B. ~87.0%, calculated as .
C. 25%, because each process is only 25% CPU-bound.
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. The system is perfectly balanced, with CPU utilization approaching 100%.
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. CPU utilization is approximately 40%, matching the CPU-bound percentage of each process.

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

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

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 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.
C. The process on Machine A writes the message to a distributed shared memory segment that is instantaneously replicated on Machine B.
D. The kernel on Machine A sends the message directly to the process on Machine B using a special hardware link.

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

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 OS's context switch routine periodically checks for invalid memory writes and terminates the process if one is found.
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 write operation succeeds, but the OS's journaling system will roll back the change upon the next system call.
D. The process receives a SIGSEGV signal from the OS after the write completes but fails verification.

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 provides high-level abstractions like file systems and processes, but allows applications to replace them, unlike a microkernel which has fixed abstractions.
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 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 race condition.
B. Starvation of P2.
C. A standard deadlock.
D. Priority inversion.

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

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. The tendency for processes of similar length to group together in the ready queue, which degrades performance in Round-Robin scheduling.
B. 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.
C. A situation where high-priority processes get blocked by low-priority ones, common in Priority-based scheduling.
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 heap contents.
B. The parent process ID (PPID).
C. The memory layout of the stack.
D. The mapping of signal handlers.

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 synchronize access to I/O devices from different 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 ensure that the CPU scheduler distributes processes evenly across all cores.
D. To manage the virtual memory page tables for all cores.