WorksheetsMCQ Exam - CO3
Total questions: 100
Worksheet time: 50mins
A process of 120 KB is loaded into a 150 KB partition. How much internal fragmentation occurs?
20 KB
30 KB
10 KB
None
Convert 512 KB to bytes.
512000
524288
500000
102400
Identify the external fragmentation if holes are: 100 KB, 300 KB, 150 KB and process = 200 KB
150 KB
100 KB
50 KB
450 KB
Explain why Best Fit leads to more fragmentation than First Fit with example: 200 KB process
Fits smaller holes
Uses biggest hole
No fragmentation
Always optimal
Choose the most suitable hole for 125 KB process among using Best Fit
130 KB
140 KB
200 KB
None
Apply First Fit for a 320 KB process on holes: 300 KB, 400 KB, 350 KB
350 KB
300 KB
400 KB
None
Determine internal fragmentation when 3 processes use partitions of 256 KB, with sizes 240 KB each
16 KB
48 KB
36 KB
32 KB
Memory allocation strategy causing least fragmentation
First Fit
Best Fit
Worst Fit
Random Fit
Memory allocation technique that wastes more memory but faster
Best Fit
Worst Fit
First Fit
Next Fit
Component resolving external symbols at runtime in dynamic linking
Loader
Compiler
Dynamic Linker
Assembler
Bytes allocated by dynamic memory allocator requesting 1500 bytes in 512-byte chunks
1500
2048
1536
1024
Absolute address if linker assigns 3000 and relative address is 250
250
2750
3250
3000
Initial memory required if program size is 800 KB with 300 KB dynamic linking
300 KB
500 KB
800 KB
100 KB
Number of undefined symbols detected by linker given object files
0
1
2
3
In an operating system, memory management is essential to ensure processes execute efficiently. One common method is paging, which divides memory into fixed-size blocks. This allows non-contiguous memory allocation and simplifies memory allocation. Which of the following is correct?
It allows memory allocation based on process size
It helps in allocating contiguous memory for each process
It breaks memory into fixed-size blocks to avoid external fragmentation
It increases internal fragmentation significantly
When a process is loaded into memory using paging, its logical address space is divided into pages, and the physical memory is divided into frames. The page table is used for address translation. Which of the following is the correct mapping mechanism?
Frame to page via TLB
Logical to physical address using page table
Physical to logical mapping using segments
Frame to segment using base and limit
Paging can lead to internal fragmentation, especially when process sizes are not multiples of page sizes. Suppose a system uses a 4KB page size and a process requires 18KB of memory. What is the internal fragmentation in this case?
2KB
4KB
6KB
8KB
Segmentation differs from paging by allowing memory to be divided based on logical divisions such as functions, arrays, and data structures. This enables better protection and sharing. What is the major disadvantage of segmentation when compared to paging?
Leads to internal fragmentation
Increases system security
Causes external fragmentation
Does not support multiprogramming
In segmentation, a logical address consists of a segment number and an offset. If the offset is larger than the segment limit, what kind of fault does the system generate, and why?
Page fault due to invalid offset
Memory overflow due to large limit
Segment fault due to invalid offset
No error occurs; memory wraps around
Segmentation provides better support for protection and sharing compared to paging. Each segment can have separate permissions and sharing attributes. Which of the following scenarios best demonstrates this advantage of segmentation?
A. A program accessing its stack segment
B. Multiple processes sharing a code segment read-only
C. A process performing I/O operations
D. A program using malloc for dynamic memory
In segmentation with paging, the logical address is divided into three parts: segment number, page number, and offset. This hybrid scheme combines the benefits of both methods. What is the primary motivation behind this approach?
A. Simplify address translation
B. Eliminate both internal and external fragmentation
C. Provide efficient memory usage with better protection
D. Increase context switching time
Virtual memory allows address translation between a process's virtual address and the actual physical memory address. For this translation to work efficiently, the virtual address is divided into two components, one used to find the page and the other the offset. What are these two components?
Segment & offset
Page number & offset
Frame number & segment
Block & segment
When a process accesses a page that is not currently in main memory, a special event occurs where the operating system must retrieve the missing page from the disk and load it into RAM. This event introduces overhead and delays execution. What is this event called?
RAM reload
Cache miss
Page fault
Memory interrupt
Suppose a 32-bit system uses a 4KB page size for managing memory. Since each page must be uniquely addressed, the total number of virtual pages that the system can manage is directly tied to the number of addressable bits and the page size. What is the total number of virtual pages?
210
212
220
222
During the execution of a program, if the data or code that a CPU needs to access is not found in the physical memory, the CPU triggers a mechanism to bring that data into RAM from the secondary storage. This leads to additional delays and memory:
Process starvation
Context switch
Page fault
Memory leak
Lazy swapping or "demand paging" brings a page into memory only when:
The process is first loaded into memory.
The operating system anticipates its need.
An attempt is made to access a location on that page.
Periodically, based on a timer.
Which page replacement algorithm selects the page that has not been used for the longest period?
FIFO (First-In, First-Out)
LRU (Least Recently Used)
Optimal
LFU (Least Frequently Used)
What is the primary advantage of using a Translation Lookaside Buffer (TLB) in a paged memory system?
To increase the capacity of physical memory
To reduce the page fault rate
To speed up the translation of logical addresses to physical addresses
To store the entire page table
When a page fault occurs, which of the following actions is NOT typically performed by the operating system?
Choose a victim frame if all frames are full.
Write the victim page to disk if it is dirty.
Load the desired page from disk into the chosen frame.
Immediately terminate the faulting process.
A system encounters a page fault, which triggers the operating system to bring the missing page from disk into RAM. If RAM is full, the OS uses a replacement algorithm to choose a page to be removed. What happens if the replaced page was modified?
The OS deletes it
The page is written back to disk
The page is ignored
A segmentation fault occurs
Consider a system with 3 page frames. For the page reference string 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5, how many page faults occur with the LRU (Least Recently Used) page replacement algorithm?
7
8
9
10
In a virtual memory system, what condition triggers the need for a page replacement?
High CPU utilization
Lack of disk space
Page fault with no free frame available
Timer interrupt
Calculate total memory wasted by internal fragmentation for 4 partitions of 512 KB
120 KB
64 KB
128 KB
96 KB
Analyze the difference in allocation success rate between First Fit and Worst Fit (200 KB process)
Same
First Fit better
Worst Fit better
None
Compare swap time of 3 processes at 40 ms each with and without parallel swapping
120 ms vs 40 ms
60 ms vs 120 ms
Same
30 ms vs 90 ms
Design an efficient memory allocation sequence for processes: 180 KB, 300 KB, 400 KB using Best Fit
180, 300, 400
400, 300, 180
300, 400, 180
180, 400, 300
Recommend an allocation strategy for minimizing fragmentation
First Fit
Worst Fit
Best Fit
Paging
Estimate total fragmentation when process sizes: 480 KB, 500 KB, 490 KB use 512 KB partitions
A) 48 KB
B) 64 KB
C) 54 KB
D) 60 KB
Number of 512-byte blocks allocated by malloc call of 4096 bytes
A) 4
B) 8
C) 6
D) 12
Number of physical memory copies of shared library used by 5 processes
1
2
Depends on OS
5
Allocation strategy resulting in largest leftover hole
First Fit
Best Fit
Worst Fit
Next Fit
Allocation method failing if 700 KB requested but only 600 KB contiguous
Segmentation
Paging
Demand Paging
Contiguous Allocation
A system with segmentation and paging uses a segment table and a page table for memory management. If a process accesses a logical address, how many memory accesses are required to translate it assuming no TLB is used?
One
Two
Three
Four
Consider a process with three segments: code, stack, and data. Each segment is divided into pages in a segmented-paging system. Which table structures are required for correct address translation?
Only one global page table
A single segment table for all processes
A segment table with individual page tables for each segment
No tables required
A 32-bit system using segmentation with paging has 4 segments per process and each segment has its own page table. If each page size is 4KB and each segment supports up to 1MB, what is the maximum number of pages per segment?
A) 128
B) 256
C) 512
D) 1024
In paging, all frames in physical memory are of the same size, which matches the page size of processes. Suppose a process requires 10 pages, but physical memory has only 6 free frames. What is the result if demand paging is enabled?
Process runs immediately using all frames
OS swaps all pages before execution
Process partially loads into memory and executes with page faults
Execution is denied
When paging is used, address translation becomes crucial. Suppose a virtual address needs to be translated into a physical address. What components are needed and what is the process involved in this translation?
Base register and segment offset
Page number and offset using page table
Frame number and segment number using TLB
Logical block number and physical block
Segmentation can simplify memory protection. Suppose a segment is marked as read-only in a program. What happens if a write operation is attempted on this segment, and why?
Operation proceeds with a warning
Operation is ignored silently
Segmentation fault occurs
System restarts
Consider a virtual memory system that uses demand paging. The system only loads pages when they are required. Suppose a program accesses a sequence of instructions located across different pages. How does demand paging impact the initial performance?
Enhances performance by preloading pages
Reduces CPU speed permanently
Causes initial delays due to page faults
Allows faster memory mapping
The working set model is used in memory management to predict which pages a process will need in the near future. It considers a window of recent page references. Which of the following best defines the working set?
All pages in the disk
Set of recently used pages in a fixed time
All pages in RAM
Random pages accessed previously
Suppose a system is experiencing frequent page faults, causing excessive disk I/O and degraded performance. The system administrator decides to increase the size of the main memory. How does this change affect the virtual memory behavior?
Increases page faults
Reduces page faults
Increases context switching
Reduces hit ratio
In a virtual memory system, each process has its own page table, which maps virtual pages to physical frames. If the page table becomes too large, it can slow down the system. What structure can the OS use to handle this problem efficiently?
Inverted page table
Hash table
Direct table
Circular queue
A virtual memory system uses both segmentation and paging. The virtual address includes a segment number, page number, and offset. What is the benefit of combining both techniques in a single system?
Increases fragmentation
Reduces protection
Enables flexible memory management
Disables multiprogramming
In memory management, the working set model defines a process's working set as the group of pages it is currently using. This model aims to reduce page faults by keeping frequently accessed pages readily available in memory. What is the working set?
The total virtual memory used by all processes
The set of pages actively used by the process during a time window
The swap memory size
The main memory size
If a page required by a running process is not found in main memory, a page fault occurs. The system must then retrieve the page from disk storage, load it into memory, and possibly replace another page to make room for it.
A segmentation fault occurs
A page hit happens
A page fault is triggered
The process is terminated
Thrashing is a condition in which an operating system becomes overwhelmed by excessive paging activity. It arises when processes collectively exceed available memory, leading to inefficient CPU utilization and decreased system throughput.
High CPU utilization
Low I/O requests
Excessive page faults
Lack of CPU scheduling
The working set model identifies the subset of memory pages a process accesses during a specific timeframe. Maintaining these pages in memory is crucial to reduce the number of page faults and ensure efficient execution.
The total virtual memory used by all processes
The set of pages actively used by the process during a time window
The swap memory size
The main memory size
The Hard Disk Drive (HDD) operates using a spinning platter, on which data is stored magnetically. This rotation enables the read/write heads to access different parts of the disk for data operations.
SSD
RAM
Magnetic disk
Cache memory
A process of 120 KB is loaded into a 150 KB partition. How much internal fragmentation occurs?
20 KB
30 KB
10 KB
None
Choose the most suitable hole for 125 KB process among using Best Fit
130 KB
140 KB
200 KB
None
Apply First Fit for a 320 KB process on holes: 300 KB, 350 KB, 400 KB
350 KB
300 KB
400 KB
None
Determine internal fragmentation when 3 processes use partitions of 256 KB, with sizes 240 KB each
16 KB
48 KB
36 KB
32 KB
In contiguous memory allocation, external fragmentation occurs when total free memory exists but is not contiguous. Which allocation technique helps reduce external fragmentation without relocating processes?
Segmentation
Paging
Static partitioning
Stack allocation
In a virtual memory system, if the page table is too large to fit in memory, which mechanism is most appropriate to reduce memory access overhead during address translation?
TLB (Translation Lookaside Buffer)
Associative Cache
Segmentation
Stack Pointer
In a demand paging system, increasing the degree of multiprogramming may lead to higher page fault rates. Which phenomenon best explains this behavior?
Fragmentation
Thrashing
Deadlock
Segmentation Fault
A process uses 10 pages out of its 100-page virtual address space frequently. The rest are rarely used. Which virtual memory technique best reduces memory usage while maintaining performance?
FIFO Page Replacement
Demand Paging
Contiguous Allocation
Compaction
In a virtual memory system, if a process’s page fault rate increases significantly with increased CPU utilization, which phenomenon is occurring?
Deadlock
Fragmentation
Thrashing
Starvation
A process accesses pages in the order: 0, 4, 1, 4, 2, 3, 4, 2, 3, 4, 2, 1, using a memory with 3 frames and FIFO replacement. How many page faults occur?
7
6
8
5
A system uses virtual memory with a page size of 4 KB. If the logical address space is 32 bits and the physical memory is 4 GB, how many bits are used for the page number in the virtual address?
10 bits
20 bits
22 bits
24 bits
A logical address is divided as follows: 3 bits for segment number, 5 bits for page number, and 8 bits for offset. What is the maximum size of the virtual address space?
4 KB
8 KB
32 KB
64 KB
A process is divided into 4 segments and each segment into pages of size 1 KB. Logical address is 16 bits, segment field is 2 bits, page field is 6 bits. What is the size of the offset field?
4 KB
8 KB
32 KB
64 KB
A process is divided into 4 segments and each segment into pages of size 1 KB. Logical address is 16 bits, segment field is 2 bits, page field is 6 bits. What is the size of the offset field?
8 bits
6 bits
10 bits
4 bits
In a segmentation system, a process has the following segment table: Segment 0 – base=1000, limit=500; Segment 1 – base=2000, limit=400. What is the physical address for logical address (1, 300)?
A) 2300
B) 1300
C) 1700
D) 2400
In a contiguous memory allocation system, assume the memory has holes of sizes 100 KB, 500 KB, 200 KB, 300 KB, and 600 KB (in order). A process requests 212 KB of memory. Using the Best Fit strategy, which block is allocated?
500 KB
600 KB
300 KB
200 KB
A system allows swapping of processes to secondary memory. A process of size 200 MB is swapped out and a new process of size 150 MB is loaded. After execution, the original process is swapped back. If no compaction is used, what is the possible cause of failure in loading the original process?
Stack overflow
External fragmentation
Invalid page fault
Memory underflow
Consider a system with fixed-size partitions: 100 KB, 250 KB, 400 KB. A process requires 260 KB. Which of the following best explains why the process cannot be allocated despite total available memory being 750 KB?
A) Internal fragmentation
B) Stack overflow
C) External fragmentation
D) Partition size limitation
Consider a memory allocation scenario with hole sizes 100 KB, 400 KB, 200 KB, 500 KB, and 300 KB. A process requests 220 KB of memory. Using the First Fit allocation strategy, which hole will be selected for allocation?
400 KB
500 KB
200 KB
300 KB
A system has memory holes of sizes 350 KB, 200 KB, 700 KB, 250 KB, and 100 KB. A process requires 310 KB of space. Using the Worst Fit strategy for contiguous memory allocation, which hole will be selected?
350 KB
700 KB
250 KB
200 KB
A system uses First Fit memory allocation. Given holes of 100 KB, 500 KB, and 200 KB in sequence, and three incoming processes requiring 90 KB, 110 KB, and 200 KB respectively, how many processes can be allocated memory without compaction?
One
Two
Three
None
Swapping involves moving processes between main memory and secondary storage. Which condition may lead to thrashing when frequent swapping occurs under high degree of multiprogramming?
Processes remain in blocked state
CPU executes I/O instructions only
Page fault rate becomes low
Most processes spend more time in swapping than execution
Consider a system with page size 1 KB and physical memory size of 32 KB. If the logical address space is 8 pages, how many bits are needed for the physical address?
10 bits
12 bits
15 bits
13 bits
A virtual memory system with demand paging has a page fault rate of 0.1 and memory access time of 100 ns. Page fault service time is 10 ms. What is the effective memory access time (EMAT)?
1.1 ms
1.01 ms
100 ns
100 ms
Consider a system with a 32-bit logical address space and a page size of 1 KB. If the system uses a two-level paging scheme where the outer page table has 256 entries, what is the number of bits used for the outer page table index?
A. 8
B. 10
C. 12
D. 16
A system uses virtual memory with a 4-level hierarchical page table. If each page table entry takes 4 bytes and page size is 4 KB, what is the total size of the page tables for mapping a 48-bit virtual address space?
4 MB
64 MB
128 MB
256 MB
Given a page reference string: 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5, and 3 frames. Using Optimal page replacement, how many page faults occur?
9
10
7
8
For a memory with 4 frames, and a reference string: 7, 0, 1, 2, 0, 3, 0, 4, 2, 3. Using Least Recently Used (LRU) page replacement, determine the number of page faults.
6
7
8
9
A system uses LRU page replacement. Given page reference string 1, 2, 3, 2, 4, 1, 5, 2 and 3 frames, how many page faults occur?
6
7
8
5
A system has a working set window of 4 pages and the process refers to the page sequence 1, 2, 3, 4, 5, 6, 2, 3, 4, 5. What is the working set size after the 10th reference?
4
5
6
3
In a demand paging system, the average memory access time is 150 ns. If the page fault rate is 0.001 and the service time for a page fault is 8 ms, calculate the effective memory access time.
8.15 μs
158 ns
8.1 μs
150 ns
Consider a virtual memory system with a FIFO page replacement policy. For an arbitrary page access pattern, increasing the number of page frames in the main memory will
Always decrease the number of page faults
Always increase the number of page faults
Sometimes increase the number of page faults
Never affect the number of page faults
A process refers to 5 pages, A, B, C, D, E in the order: A, B, C, D, A, B, E, A, B, C, D, E. If the page replacement algorithm is FIFO, the number of page transfers with an empty internal store of 3 frames is?
8
10
9
7
A program has three modules with sizes 4 KB, 6 KB, and 8 KB respectively. The dynamic linker uses lazy binding and loads only necessary modules during execution. If only the first two modules are used during a particular run, what is the total memory occupied by the loaded modules?
10 KB
18 KB
8 KB
20 KB
If a logical address consists of a 4-bit segment number, 3-bit page number, and 10-bit offset, what is the total logical address size in bits and the total logical address space in KB?
17 bits, 128 KB
17 bits, 256 KB
17 bits, 64 KB
20 bits, 256 KB
A system with 32-bit logical address space uses demand paging with a page size of 4 KB. If the memory contains 256 frames, how many bits are used for the frame number in the physical address?
8 bits
10 bits
12 bits
16 bits
Calculate the effective memory access time if the memory access time is 100 ns, page fault service time is 10 ms, and page fault rate is 0.001.
109,900 ns
10,000 ns
199 ns
10,100 ns
A system uses LRU page replacement. The reference string is: 1, 2, 3, 4, 2, 1, 5, 6, 2, 1, 2, 3, 7. If the number of frames is 3, how many page faults will occur?
11
10
9
8
A process has a working set size of 4 pages and currently allocated 3 frames. If the page-fault frequency is high, what should be the minimum number of frames allocated to reduce thrashing?
2
3
4
5
A disk has 5000 cylinders. The request queue has requests for cylinders 40, 10, 4500, 4000, 30, 1000. If the disk arm is currently at cylinder 50, calculate the total head movement using the SCAN algorithm moving towards higher cylinder numbers.
4990 cylinders
4960 cylinders
5030 cylinders
5100 cylinders
A program has 5 dynamically linked libraries each of 12 KB. If only 3 libraries are loaded dynamically at runtime, what is the total dynamic memory used for libraries?
36 KB
60 KB
48 KB
72 KB
A dynamic storage system uses a buddy system. The total free memory is 1024 KB. If a request of 140 KB arrives, what is the size of the allocated block?
128 KB
256 KB
512 KB
1024 KB
