Unit 1: Operating System Basics - Practice Quiz

CSE357 — Combinatorial Studies 50 Questions
0 Correct 0 Wrong 50 Left
0/50

1 What is the primary role of an Operating System as a resource manager?

A. To compile source code into machine code
B. To arbitrate conflicting requests for resources and allocate them efficiently
C. To provide a graphical user interface for applications
D. To perform high-speed mathematical calculations

2 Which component of the Operating System resides in the main memory and interacts directly with the hardware?

A. Command Interpreter
B. Compiler
C. Kernel
D. Shell

3 In a Time-Sharing System, what is the primary mechanism used to switch the CPU between users?

A. First-Come, First-Served
B. Virtual Memory
C. Context Switching
D. Deadlock Avoidance

4 Which of the following characterizes a Hard Real-Time System?

A. Deadlines are desirable but not mandatory
B. Missing a deadline results in total system failure
C. Throughput is the only metric of importance
D. It is used primarily for batch processing

5 What is the mode bit used for in modern processors?

A. To indicate if the printer is ready
B. To switch between 32-bit and 64-bit processing
C. To distinguish between User Mode and Kernel Mode
D. To flag a page fault

6 Which system call is used in UNIX/Linux to create a new process?

A. fork()
B. create()
C. init()
D. new()

7 What information is stored in the Process Control Block (PCB)?

A. The list of all users on the system
B. Process state, Program Counter, CPU registers, and scheduling info
C. The file system directory structure
D. The source code of the program

8 In the context of Process State transitions, when does a process move from Running to Ready?

A. When an interrupt (like a timer expiry) occurs
B. When it finishes execution
C. When it requests I/O
D. When it creates a child process

9 What is long-term scheduling responsible for?

A. Swapping processes in and out of memory
B. Handling interrupts
C. Selecting which processes are brought into the ready queue from the job pool
D. Selecting which process should be executed next by the CPU

10 If the Degree of Multiprogramming is too high, what phenomenon might occur?

A. Fragmentation
B. Deadlock
C. Thrashing
D. Starvation

11 Calculate the Turnaround Time () if the Completion Time () is 15ms and the Arrival Time () is 3ms.

A. 45ms
B. 5ms
C. 12ms
D. 18ms

12 Which scheduling algorithm suffers from the Convoy Effect?

A. First-Come, First-Served (FCFS)
B. Shortest Job First (SJF)
C. Round Robin (RR)
D. Priority Scheduling

13 In Shortest Job First (SJF) scheduling, what is the main difficulty in implementation?

A. It is impossible to know the length of the next CPU burst in advance
B. It leads to frequent context switches
C. It does not support multiprogramming
D. It requires complex data structures

14 Which scheduling algorithm is designed specifically for Time-Sharing Systems?

A. Multilevel Queue
B. Round Robin
C. First-Come, First-Served
D. Shortest Job First

15 In Priority Scheduling, what technique is used to solve the problem of Starvation?

A. Aging
B. Swapping
C. Paging
D. Context Switching

16 Consider three processes P1, P2, P3 with burst times 10, 5, and 8 respectively. In FCFS, if they arrive in order P1, P2, P3, what is the waiting time for P3?

A. 23
B. 15
C. 10
D. 0

17 What is the definition of Throughput in CPU scheduling?

A. The percentage of time the CPU is busy
B. The time from submission to completion
C. The amount of time a process spends waiting in the ready queue
D. The number of processes that complete their execution per time unit

18 In a Multilevel Feedback Queue, a process that uses too much CPU time is usually:

A. Moved to a higher priority queue
B. Terminated immediately
C. Left in the same queue
D. Moved to a lower priority queue

19 Which type of memory fragmentation occurs when there is enough total free space to satisfy a request, but the available spaces are not contiguous?

A. Segmentation Fault
B. Internal Fragmentation
C. Page Fault
D. External Fragmentation

20 In Paging, the physical memory is divided into fixed-sized blocks called:

A. Sectors
B. Frames
C. Pages
D. Segments

21 The mapping of a logical address to a physical address is done in hardware by the:

A. Memory Management Unit (MMU)
B. Direct Memory Access (DMA)
C. Arithmetic Logic Unit (ALU)
D. Translation Lookaside Buffer (TLB)

22 If a logical address consists of a page number and an offset , the physical address is generated by:

A. Adding to the base register
B. Using as an index into the page table to find frame , then combining with
C. Multiplying by the frame size
D. Subtracting from the limit register

23 What is the purpose of the Translation Lookaside Buffer (TLB)?

A. To cache recently used page-table entries to speed up address translation
B. To store dirty pages before writing to disk
C. To store the entire page table
D. To handle page faults

24 What is Internal Fragmentation?

A. When memory is scattered in non-contiguous blocks
B. When memory is allocated in fixed-sized blocks and the process needs less than the allocated block size
C. When the page table becomes too large
D. When the hard disk is fragmented

25 Which page replacement algorithm suffers from Belady's Anomaly?

A. LRU (Least Recently Used)
B. LFU (Least Frequently Used)
C. Optimal
D. FIFO (First-In, First-Out)

26 What is the Optimal Page Replacement algorithm?

A. Replace the page with the lowest frequency count
B. Replace the page that was used least recently
C. Replace the page that will not be used for the longest period of time
D. Replace the page that has been in memory the longest

27 In Segmentation, a logical address consists of:

A. Segment number, Offset
B. Base, Limit
C. Frame number, Key
D. Page number, Offset

28 Which bit in a page table entry indicates whether the page has been modified (written to)?

A. Dirty (Modify) bit
B. Reference bit
C. Protection bit
D. Valid/Invalid bit

29 What is a Race Condition?

A. A scheduling algorithm for real-time systems
B. A condition where a process runs faster than the CPU clock
C. A situation where multiple processes read and write shared data concurrently and the outcome depends on the order of execution
D. When two processes try to print at the same time

30 The segment of code where a process accesses shared resources is called the:

A. Remainder Section
B. Exit Section
C. Critical Section
D. Entry Section

31 Which of the following is NOT a requirement for a solution to the Critical Section Problem?

A. Bounded Waiting
B. Mutual Exclusion
C. First-Come First-Served
D. Progress

32 What is a Semaphore?

A. A hardware interrupt
B. A distinct memory segment
C. A type of system call for I/O
D. An integer variable accessed only through two atomic operations: wait() and signal()

33 If a semaphore is initialized to 1, and process P1 executes wait(S), what is the new value of ?

A. 2
B. 1
C. 0
D. -1

34 What is a Binary Semaphore often called?

A. Monitor
B. Counter
C. Spinlock
D. Mutex Lock

35 In the Producer-Consumer problem using a bounded buffer, what happens if the buffer is full?

A. Data is overwritten
B. The Consumer blocks
C. The Producer blocks
D. The system crashes

36 Which of the following is NOT a necessary condition for Deadlock to occur (Coffman conditions)?

A. Mutual Exclusion
B. Preemption
C. Circular Wait
D. Hold and Wait

37 The Banker's Algorithm is used for:

A. Deadlock Detection
B. Deadlock Recovery
C. Deadlock Avoidance
D. Deadlock Prevention

38 What does the Circular Wait condition imply?

A. Memory is allocated in a circular buffer
B. A set of processes exists such that waits for , waits for , ..., waits for
C. The scheduler uses Round Robin
D. Processes are waiting in a circle for CPU time

39 Which Inter-process Communication (IPC) mechanism allows data to flow in only one direction?

A. Socket
B. Message Queue
C. Ordinary Pipe (Anonymous Pipe)
D. Shared Memory

40 What is the Dining Philosophers Problem an example of?

A. Memory Management issues
B. File System corruption
C. CPU Scheduling efficiency
D. Synchronization and Deadlock issues

41 In a system with instances of a resource and processes, if , what can be said about Deadlock?

A. The system is in an unsafe state
B. Deadlock might occur depending on timing
C. Deadlock will never occur
D. Deadlock is inevitable

42 What is a Spinlock?

A. A type of deadlock
B. A scheduling queue
C. A hard disk mechanism
D. A lock where a thread loops (spins) while waiting for the lock to become available

43 In the context of IPC, what does Message Passing involve?

A. Using CPU registers directly
B. Using send() and receive() primitives
C. Two processes sharing a variable in memory
D. Writing to a hard disk file

44 What is the main advantage of Threads over Processes?

A. Threads are more secure
B. Threads have their own memory space
C. Threads cannot deadlock
D. Context switching between threads is faster and they share resources

45 Which variable in a Semaphore implementation must be protected by a critical section?

A. The integer value of the semaphore
B. The process ID
C. The system clock
D. The name of the semaphore

46 What is the Resource Allocation Graph (RAG) used for?

A. Scheduling CPUs
B. Managing file permissions
C. Detecting Deadlocks
D. Visualizing memory allocation

47 In Demand Paging, when is a page brought into memory?

A. Only when it is explicitly requested/accessed during execution
B. Every 5 milliseconds
C. When the process starts
D. Before the CPU schedules the process

48 If the Time Quantum in Round Robin scheduling is extremely large, the algorithm behaves like:

A. First-Come, First-Served (FCFS)
B. Priority Scheduling
C. Shortest Job First (SJF)
D. Multilevel Queue

49 Which memory placement strategy allocates the smallest hole that is big enough?

A. Next-Fit
B. Worst-Fit
C. First-Fit
D. Best-Fit

50 What distinguishes User-Level Threads from Kernel-Level Threads?

A. User threads can run on different processors simultaneously
B. Kernel threads are faster to create
C. User threads are managed by the kernel
D. User threads are managed by a library without kernel support