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. Command Interpreter
B. Kernel
C. Compiler
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. Deadlock Avoidance
D. Context Switching

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

A. Deadlines are desirable but not mandatory
B. It is used primarily for batch processing
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 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. init()
C. create()
D. new()

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

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

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. Swapping processes in and out of memory
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. Thrashing
B. Starvation
C. Fragmentation
D. Deadlock

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

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

12 Which scheduling algorithm suffers from the Convoy Effect?

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

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

A. It does not support multiprogramming
B. It requires complex data structures
C. It leads to frequent context switches
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. 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. Swapping
B. Paging
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. 0
B. 15
C. 23
D. 10

17 What is the definition of Throughput in CPU scheduling?

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

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

A. Pages
B. Sectors
C. Segments
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. Using as an index into the page table to find frame , then combining with
B. Subtracting from the limit register
C. Multiplying by the frame size
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 page table becomes too large
B. When the hard disk is fragmented
C. When memory is allocated in fixed-sized blocks and the process needs less than the allocated block size
D. When memory is scattered in non-contiguous blocks

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

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

26 What is the Optimal Page Replacement algorithm?

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

27 In Segmentation, a logical address consists of:

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

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

A. Reference bit
B. Protection bit
C. Valid/Invalid bit
D. Dirty (Modify) 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. When two processes try to print at the same time
D. A situation where multiple processes read and write shared data concurrently and the outcome depends on the order of execution

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

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

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

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

32 What is a Semaphore?

A. A distinct memory segment
B. A hardware interrupt
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. 1
B. -1
C. 2
D. 0

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. The system crashes
B. The Producer blocks
C. The Consumer blocks
D. Data is overwritten

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

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

37 The Banker's Algorithm is used for:

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

38 What does the Circular Wait condition imply?

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

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. File System corruption
B. CPU Scheduling efficiency
C. Memory Management issues
D. Synchronization and Deadlock issues

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

42 What is a Spinlock?

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

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. Writing to a hard disk file
D. Using send() and receive() primitives

44 What is the main advantage of Threads over Processes?

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

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

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

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

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

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

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

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

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

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

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

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

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