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

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

A. First-Come, First-Served
B. Context Switching
C. Virtual Memory
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 distinguish between User Mode and Kernel Mode
B. To indicate if the printer is ready
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. 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. Process state, Program Counter, CPU registers, and scheduling info
C. The list of all users on the system
D. The file system directory structure

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

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

9 What is long-term scheduling responsible for?

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

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

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

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

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

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 is impossible to know the length of the next CPU burst in advance
C. It requires complex data structures
D. It does not support multiprogramming

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

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

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

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

17 What is the definition of Throughput in CPU scheduling?

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

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

A. Moved to a higher priority queue
B. Moved to a lower 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. Internal Fragmentation
B. External Fragmentation
C. Page Fault
D. Segmentation Fault

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

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

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

A. Memory Management Unit (MMU)
B. Arithmetic Logic Unit (ALU)
C. Direct Memory Access (DMA)
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 store the entire page table
B. To cache recently used page-table entries to speed up address translation
C. To handle page faults
D. To store dirty pages before writing to disk

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 memory is scattered in non-contiguous blocks
C. When the hard disk is fragmented
D. When the page table becomes too large

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 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 that was used least recently
D. Replace the page with the lowest frequency count

27 In Segmentation, a logical address consists of:

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

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. Entry Section
B. Critical Section
C. Remainder Section
D. Exit Section

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

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

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. 0
B. 1
C. 2
D. -1

34 What is a Binary Semaphore often called?

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

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

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

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

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

37 The Banker's Algorithm is used for:

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

38 What does the Circular Wait condition imply?

A. Processes are waiting in a circle for CPU time
B. A set of processes exists such that waits for , waits for , ..., waits for
C. Memory is allocated in a circular buffer
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. Ordinary Pipe (Anonymous Pipe)
D. Message Queue

40 What is the Dining Philosophers Problem an example of?

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

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

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

42 What is a Spinlock?

A. A lock where a thread loops (spins) while waiting for the lock to become available
B. A hard disk mechanism
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 send() and receive() primitives
C. Writing to a hard disk file
D. Using CPU registers directly

44 What is the main advantage of Threads over Processes?

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

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. Scheduling CPUs
B. Visualizing memory allocation
C. Detecting Deadlocks
D. Managing file permissions

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

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

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

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

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. User threads are managed by the kernel
B. Kernel threads are faster to create
C. User threads are managed by a library without kernel support
D. User threads can run on different processors simultaneously