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 arbitrate conflicting requests for resources and allocate them efficiently
B. To perform high-speed mathematical calculations
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. Kernel
B. Compiler
C. Command Interpreter
D. Shell

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

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

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

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

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

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

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

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

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

A. Process state, Program Counter, CPU registers, and scheduling info
B. The file system directory structure
C. The list of all users on the system
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 it creates a child process
B. When an interrupt (like a timer expiry) occurs
C. When it finishes execution
D. When it requests I/O

9 What is long-term scheduling responsible for?

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

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

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

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

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

12 Which scheduling algorithm suffers from the Convoy Effect?

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

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

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

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

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

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

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

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 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. Page Fault
B. Internal Fragmentation
C. Segmentation Fault
D. External Fragmentation

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

A. Segments
B. Sectors
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. Adding to the base register
B. Subtracting from the limit register
C. Using as an index into the page table to find frame , then combining with
D. Multiplying by the frame size

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 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 memory is scattered in non-contiguous blocks
D. When the hard disk is fragmented

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

A. Optimal
B. LFU (Least Frequently Used)
C. LRU (Least Recently Used)
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 has been in memory the longest
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. Segment number, Offset
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. Valid/Invalid bit
B. Dirty (Modify) bit
C. Protection bit
D. Reference bit

29 What is a Race Condition?

A. When two processes try to print at the same time
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. A scheduling algorithm for real-time systems

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

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

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

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

32 What is a Semaphore?

A. A type of system call for I/O
B. A distinct memory segment
C. A hardware interrupt
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. 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. Data is overwritten
C. The Consumer blocks
D. The Producer blocks

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

A. Circular Wait
B. Preemption
C. Hold and 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. A set of processes exists such that waits for , waits for , ..., waits for
B. Processes are waiting in a circle for CPU time
C. The scheduler uses Round Robin
D. Memory is allocated in a circular buffer

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

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

40 What is the Dining Philosophers Problem an example of?

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

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

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

42 What is a Spinlock?

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

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

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

44 What is the main advantage of Threads over Processes?

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

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

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

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

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

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

A. When the process starts
B. Every 5 milliseconds
C. Before the CPU schedules the process
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. Shortest Job First (SJF)
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. Best-Fit
C. Worst-Fit
D. Next-Fit

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

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