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 provide a graphical user interface for applications
C. To arbitrate conflicting requests for resources and allocate them efficiently
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. Shell
B. Kernel
C. Compiler
D. Command Interpreter

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

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

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

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

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

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

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

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

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

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

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. Selecting which processes are brought into the ready queue from the job pool
B. Selecting which process should be executed next by the CPU
C. Handling interrupts
D. Swapping processes in and out of memory

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

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

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

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

12 Which scheduling algorithm suffers from the Convoy Effect?

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

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

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

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

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

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

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

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. 0
C. 10
D. 15

17 What is the definition of Throughput in CPU scheduling?

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

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

A. Moved to a lower priority queue
B. Moved to a higher priority queue
C. Terminated immediately
D. Left in the same 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. Segments
C. Pages
D. Frames

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

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

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

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

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

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

24 What is Internal Fragmentation?

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

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

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

26 What is the Optimal Page Replacement algorithm?

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

27 In Segmentation, a logical address consists of:

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

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

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

29 What is a Race Condition?

A. A condition where a process runs faster than the CPU clock
B. A scheduling algorithm for real-time systems
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. Critical Section
B. Entry Section
C. Exit Section
D. Remainder Section

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

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

32 What is a Semaphore?

A. A type of system call for I/O
B. A hardware interrupt
C. A distinct memory segment
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. 0
B. 1
C. -1
D. 2

34 What is a Binary Semaphore often called?

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

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

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

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

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

37 The Banker's Algorithm is used for:

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

38 What does the Circular Wait condition imply?

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

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

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

40 What is the Dining Philosophers Problem an example of?

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

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

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

42 What is a Spinlock?

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

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

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

44 What is the main advantage of Threads over Processes?

A. Threads have their own memory space
B. Threads are more secure
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 process ID
B. The system clock
C. The integer value of the semaphore
D. The name of the semaphore

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

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

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

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

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

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

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

A. Worst-Fit
B. Best-Fit
C. Next-Fit
D. First-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