Unit 1 - Practice Quiz

CSE357 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 perform high-speed mathematical calculations
B. To arbitrate conflicting requests for resources and allocate them efficiently
C. To compile source code into machine code
D. To provide a graphical user interface for applications

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

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

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

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

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. Missing a deadline results in total system failure
D. Throughput is the only metric of importance

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

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

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

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

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

A. The file system directory structure
B. The source code of the program
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 it finishes execution
B. When an interrupt (like a timer expiry) occurs
C. When it requests I/O
D. When it creates a child process

9 What is long-term scheduling responsible for?

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

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

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

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

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

12 Which scheduling algorithm suffers from the Convoy Effect?

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

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

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

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

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

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

A. Paging
B. Swapping
C. Aging
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. 15
B. 0
C. 10
D. 23

17 What is the definition of Throughput in CPU scheduling?

A. The time from submission to completion
B. The percentage of time the CPU is busy
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. Left in the same queue
B. Terminated immediately
C. Moved to a lower priority queue
D. Moved to a higher 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. Internal Fragmentation
B. Page Fault
C. External Fragmentation
D. Segmentation Fault

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

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

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

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

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 handle page faults
B. To store dirty pages before writing to disk
C. To store the entire page table
D. To cache recently used page-table entries to speed up address translation

24 What is Internal Fragmentation?

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

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

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

26 What is the Optimal Page Replacement algorithm?

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

27 In Segmentation, a logical address consists of:

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

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

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

29 What is a Race Condition?

A. A situation where multiple processes read and write shared data concurrently and the outcome depends on the order of execution
B. A condition where a process runs faster than the CPU clock
C. A scheduling algorithm for real-time systems
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. Exit Section
B. Remainder Section
C. Entry Section
D. Critical Section

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

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

32 What is a Semaphore?

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

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

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

34 What is a Binary Semaphore often called?

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

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

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

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

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

37 The Banker's Algorithm is used for:

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

38 What does the Circular Wait condition imply?

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

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

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

40 What is the Dining Philosophers Problem an example of?

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

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. Deadlock is inevitable
C. The system is in an unsafe state
D. Deadlock will never occur

42 What is a Spinlock?

A. A scheduling queue
B. A hard disk mechanism
C. A type of deadlock
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. Writing to a hard disk file
D. Two processes sharing a variable in memory

44 What is the main advantage of Threads over Processes?

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

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

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

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

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

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

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

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

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

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

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

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

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