This section contains carefully selected MCQs and Previous Year Questions with explanations to help students understand concepts and prepare effectively for examinations, interviews, and competitive tests.
Q: 1In a paging system with a Translation Lookaside Buffer (TLB), the TLB has a hit ratio of 80%. It takes 20 nanoseconds to search the TLB and 100 nanoseconds to access main memory. What is the effective memory access time?
Option B
Q: 2Which of the following statements is correct?
(i) A hard disk is also used to provide an extension to the main memory known as virtual memory.
(ii) DRAM is faster than SRAM.
(iii) External, non-volatile memory is also referred to as ‘secondary memory’ or ‘auxiliary memory’.
Option C
Computer systems use different types of memory for storing data and programs. These memories differ in terms of speed, capacity, volatility, and cost.
Main Memory (RAM) is fast but limited in size, while secondary memory such as hard disks provides large storage capacity. Technologies such as virtual memory help bridge this gap.
The statement (i) is True. When RAM becomes full, the operating system uses a portion of the hard disk (or SSD) as virtual memory.
Virtual memory acts as an extension of RAM and allows larger programs to run even when physical RAM is insufficient.
The statement (ii) is False. DRAM (Dynamic RAM) is slower because it requires periodic refreshing of data. SRAM (Static RAM) is faster because it does not require refreshing and is commonly used in cache memory.
| Feature | DRAM | SRAM |
|---|---|---|
| Full Form | Dynamic RAM | Static RAM |
| Speed | Slower | Faster |
| Refresh Required | Yes | No |
| Cost | Cheaper | Expensive |
| Used In | Main Memory (RAM) | Cache Memory |
The statement (iii) is True. The memory type Hard Disk, SSD, CD/DVD, Pen Drive retain data even after power is switched off, so they are called:
Q: 3The memory allocation technique used in paging may have:
Option B
Paging is a memory management technique that divides physical memory into fixed-size blocks called frames and logical memory into blocks of the same size called pages. Pages are mapped to frames using a page table, allowing non-contiguous allocation of memory.
| TYPE OF FRAGMENTATION | DESCRIPTION |
|---|---|
| Internal Fragmentation. | Occurs when the last allocated page/frame is not fully used. Wasted memory inside allocated blocks due to fixed-size allocation. Paging may cause internal fragmentation because the last page of a process might not be completely filled. |
| External Fragmentation. | Occurs when there is enough total memory to satisfy a request, but it is not contiguous. Wasted memory outside allocated blocks due to scattered free memory. |
Q: 4The technique which move the program blocks to or from the physical memory is called as ____________.
Option B
In operating systems, Virtual Memory is a technique that allows a program to execute even if it is not completely loaded into physical memory. The program is divided into smaller parts or blocks (pages or segments), and these blocks are automatically moved between secondary memory (disk) and physical memory (RAM) as required during execution.
When a required block is not present in memory, it is brought from disk (page-in), and less needed blocks may be moved back to disk (page-out).
Q: 5If the page size is ‘n’ bytes, the maximum number of bytes unutilized due to internal fragmentation is
Option C
Internal Fragmentation occurs in paging when a process does not completely fill the last allocated page. Since memory is allocated in fixed-size pages of n bytes, the unused space can only exist in the last page of the process.
In the worst case, the process may require just 1 byte in the last page, leaving the remaining (n-1) bytes unused. This is the maximum possible internal fragmentation.
Q: 6If there are 64 segments, each of size 2KB, then how many bits should a logical address have?
Option D
Segmentation is a memory management technique in which a program is divided into logical parts called segments. Each segment contains a specific type of information, such as the main program, functions, arrays, stack, or data.
In segmentation, the memory address generated by the CPU is called a Logical Address, which consists of two parts:
Therefore, the size of a logical address depends on the number of bits required to represent the segment number and the offset.
Given that there are 64 segments, the segment number field must be able to represent 64 different segments i.e., 64 = 26.
Hence, 6 bits are required for the segment number.
Each segment has a size of 2 KB.
Therefore, 11 bits are required for the offset field.
The total size of the logical address is: Segment Number Bits + Offset Bits
Therefore, A logical address in segmentation consists of a segment number and an offset. For 64 segments of size 2 KB each, the logical address requires 17 bits.
Q: 7In a system with a 32-bit logical address space and a page size of 4 KB approximately, how many entries are there in the page table?
Option A
In a paging system, the logical address space is divided into fixed-size pages, and a page table maps each logical page to a physical frame in memory. In this problem, the system has a 32-bit logical address space, which means it can address 232 bytes.
The page size is given as 4 KB, which is 212 bytes. To find the number of pages, we divide the total logical address space by the page size: 232/ 212=220.
Since each page requires one entry in the page table, the page table will contain 220 entries.
Q: 8A computer installation has 1000 KB of main memory. Jobs arrive and finish in the following sequence.
Job 1 requiring 200 KB arrives
Job 2 requiring 350 KB arrives
Job 3 requiring 300 KB arrives
Job 1 finishes
Job 4 requiring 120 KB arrives
Job 5 requiring 150 KB arrives
Job 6 requiring 70 KB arrives
Between best-fit and first-fit, which one will perform better for this process sequence?
Option A
In contiguous memory allocation, when a process requests memory, the operating system must choose a suitable free memory block. Different memory allocation strategies use different criteria for selecting a free block.
| Strategy | Description |
|---|---|
| First-Fit | Allocates the first free block that is large enough to satisfy the request. |
| Best-Fit | Allocates the smallest free block that is large enough to satisfy the request. This minimizes immediate wastage. |
| Worst-Fit | Allocates the largest available free block so that a large free block remains after allocation. |
To determine which strategy performs better, we must allocate the jobs one by one and observe the remaining free memory blocks.
Total Main Memory = 1000 KB
| Job | Memory Required |
|---|---|
| Job 1 | 200 KB |
| Job 2 | 350 KB |
| Job 3 | 300 KB |
| Job 1 Finishes | Frees 200 KB |
| Job 4 | 120 KB |
| Job 5 | 150 KB |
| Job 6 | 70 KB |
First-Fit Allocation:
| Request | Available Block Analysis | Selected Block | Remaining Block |
|---|---|---|---|
| Job 1 (200 KB) | Entire memory (1000 KB) is free. | 1000 KB | 800 KB |
| Job 2 (350 KB) | First free block is 800 KB. | 800 KB | 450 KB |
| Job 3 (300 KB) | First free block is 450 KB. | 450 KB | 150 KB |
| Job 1 Finishes | Job 1 releases its 200 KB block | — | Free Blocks 200 KB, 150 KB |
| Job 4 (120 KB) | First free block (200 KB) is sufficient. | 200 KB | 80 KB, 150 KB |
| Job 5 (150 KB) | 80 KB is insufficient, next free block (150 KB) fits exactly. | 150 KB | 80 KB |
| Job 6 (70 KB) | First free block (80 KB) is sufficient. | 80 KB | 10 KB |
Memory Layout After Each Step:
| Step | Memory Layout |
|---|---|
| After Job 1 | J1(200) | Free(800) |
| After Job 2 | J1(200) | J2(350) | Free(450) |
| After Job 3 | J1(200) | J2(350) | J3(300) | Free(150) |
| After Job 1 Finishes | Free(200) | J2(350) | J3(300) | Free(150) |
| After Job 4 | J4(120) | Free(80) | J2(350) | J3(300) | Free(150) |
| After Job 5 | J4(120) | Free(80) | J2(350) | J3(300) | J5(150) |
| After Job 6 | J4(120) | J6(70) | Free(10) | J2(350) | J3(300) | J5(150) |
All jobs are successfully allocated using First-Fit.
Best-Fit Allocation:
In Best-Fit, the operating system always chooses the smallest free block that is large enough to satisfy the memory request.
| Request | Available Block Analysis | Selected Block | Remaining Block |
|---|---|---|---|
| Job 1 (200 KB) | Only free block is 1000 KB | 1000 KB | 800 KB |
| Job 2 (350 KB) | Only free block is 800 KB | 800 KB | 450 KB |
| Job 3 (300 KB) | Only free block is 450 KB | 450 KB | 150 KB |
| Job 1 Finishes | Job 1 releases its 200 KB block. | — | Free Blocks 200 KB, 150 KB |
| Job 4 (120 KB) | Suitable blocks: 200 KB, 150 KB. Smallest suitable block is 150 KB. | 150 KB | 200KB, 30 KB |
| Job 5 (150 KB) | Suitable block: 200 KB only. | 200 KB | 50 KB, 30 KB |
| Job 6 (70 KB) | Available blocks: 50 KB and 30 KB. Both are smaller than 70 KB. | Not Allocated | — |
Memory Layout After Each Step:
| Step | Memory Layout |
|---|---|
| After Job 1 | J1(200) | Free(800) |
| After Job 2 | J1(200) | J2(350) | Free(450) |
| After Job 3 | J1(200) | J2(350) | J3(300) | Free(150) |
| After Job 1 Finishes | Free(200) | J2(350) | J3(300) | Free(150) |
| After Job 4 | Free(200) | J2(350) | J3(300) | J4(120) | Free(30) |
| After Job 5 | J5(150) | Free(50) | J2(350) | J3(300) | J4(120) | Free(30) |
| After Job 6 | J5(150) | Free(50) | J2(350) | J3(300) | J4(120) | Free(30) |
Since neither 50 KB nor 30 KB is large enough, Job 6 cannot be allocated, even though the total free memory is 50+30=80 KB. This is an example of External Fragmentation.
Using Best-Fit, Job 6 cannot be allocated because memory becomes fragmented into small free blocks.
Therefore, for the given sequence, Best-Fit performs worse than First-Fit.
Q: 9If the page size in a 32-bit machine is 4K bytes then the size of page table is
Option C
In a 32-bit machine, the total addressable memory is 232 bytes. The given page size is 4 KB, which is equal to 212 bytes. Therefore, the total number of pages is 232/212=220 pages.
Each page requires one entry in the page table. If we assume that each page table entry occupies 4 bytes, then the total size of the page table becomes 220*4=222 bytes, which is equal to 4 MB. Thus, the size of the page table is 4 Mbytes.
Q: 10A page fault occurs when
Option D
A Page Fault occurs in a Virtual Memory system when a program tries to access a page that is not currently present in the main memory (RAM). In this case, the operating system interrupts the process and brings the required page from secondary storage into memory, and then execution continues.
Q: 11If 2n words are in main memory and 2K words are in cache memory, then the bits for tag field and index field of a n-bit memory address are respectively,
Option C
In Cache Memory, a main memory address is divided into tag, index, and block offset fields if using Direct Mapping.
If main memory has 2n words and cache has 2K words, then:
Index field = K bits (To select one of 2K cache lines)
Tag field = n−K bits (Remaining bits to identify the memory block)
Q: 12Which of the following is (are) true about virtual memory system that uses pages?
I. The virtual address space can be larger than the about of physical memory.
II. Programs must be resident in main memory throughout their execution.
III. Pages correspond to semantic characteristics of the program.
Option A
In a virtual memory system that uses paging, the virtual address space can be larger than the available physical memory, because only the required pages of a program are loaded into main memory at any given time, while the rest remain on secondary storage. Hence, statement I is true.
Statement II is false because a program does not need to be completely resident in main memory throughout its execution, only the currently needed pages are brought into memory on demand.
Statement III is false because pages are fixed-size blocks determined by the system, not based on the semantic or logical structure of the program.
Q: 13The process of organizing the memory into two banks to allow 8 bit and 16-bit data operation is called
Option C
Memory Interleaving is a technique used to improve memory performance by dividing memory into multiple banks so that they can be accessed simultaneously.
In two-way memory interleaving, memory is organized into two banks, allowing:
This increases data transfer speed and improves overall system performance.
Q: 14Which of the following describes a 32 X 8 ROM?
Option B
A Read Only Memory (ROM) is a type of non-volatile memory used to store data permanently. The notation “m × n” in memory terminology means that the ROM contains m words, and each word consists of n bits.
In a 32 × 8 ROM, there are 32 memory locations, and each location can store 8 bits of data. This means the ROM can store a total of 32×8=256 bits of information. Hence, a 32 × 8 ROM is best described as “32 words of 8 bits each.”
Q: 15Consider the following page reference string:
1, 2, 3, 2, 4, 1, 3, 2, 4, 1
Assume that there are three page frames which are initially empty. Let LRU, FIFO and OPTIMAL denote the number of page faults under the corresponding page replacement strategy. Then, which of the following expression is true?
Option D
In a paging system, when a required page is not present in memory, a page fault occurs. If all page frames are occupied, the operating system must decide which page to replace. This decision is made using a Page Replacement Algorithm.
| Algorithm | Description |
|---|---|
| FIFO (First In First Out) | Replaces the page that entered memory first. |
| LRU (Least Recently Used) | Replaces the page that has not been used for the longest time. |
| OPTIMAL (OPT) | Replaces the page that will not be used for the longest time in the future. This gives the minimum possible page faults. |
Page Reference String:
FIFO Page Replacement:
| Page Reference | Frame Contents | Fault/Hit |
|---|---|---|
| 1 | 1 | Fault |
| 2 | 1 2 | Fault |
| 3 | 1 2 3 | Fault |
| 2 | 1 2 3 | Hit |
| 4 | 4 2 3 | Fault |
| 1 | 4 1 3 | Fault |
| 3 | 4 1 3 | Hit |
| 2 | 4 1 2 | Fault |
| 4 | 4 1 2 | Hit |
| 1 | 4 1 2 | Hit |

Total FIFO Page Faults : 6
LRU Page Replacement:
| Page Reference | Frame Contents | Fault/Hit |
|---|---|---|
| 1 | 1 | Fault |
| 2 | 1 2 | Fault |
| 3 | 1 2 3 | Fault |
| 2 | 1 2 3 | Hit |
| 4 | 4 2 3 | Fault |
| 1 | 4 2 1 | Fault |
| 3 | 4 3 1 | Fault |
| 2 | 2 3 1 | Fault |
| 4 | 2 3 4 | Fault |
| 1 | 2 1 4 | Fault |

Total LRU Page Faults : 9
OPTIMAL Page Replacement:
| Page Reference | Frame Contents | Fault/Hit |
|---|---|---|
| 1 | 1 | Fault |
| 2 | 1 2 | Fault |
| 3 | 1 2 3 | Fault |
| 2 | 1 2 3 | Hit |
| 4 | 1 4 3 | Fault |
| 1 | 1 4 3 | Hit |
| 3 | 1 4 3 | Hit |
| 2 | 1 4 2 | Fault |
| 4 | 1 4 2 | Hit |
| 1 | 1 4 2 | Hit |

Total OPTIMAL Page Faults : 5
The total number of page faults obtained using the three page replacement algorithms are 5 for OPTIMAL, 6 for FIFO, and 9 for LRU.
Therefore, the OPTIMAL algorithm generates the fewest page faults, followed by FIFO, while LRU generates the highest number of page faults.
Hence, the correct relationship among them is OPTIMAL<FIFO<LRU.
Thank you so much for taking the time to read my Computer Science MCQs section carefully. Your support and interest mean a lot, and I truly appreciate you being part of this journey. Stay connected for more insights and updates! If you'd like to explore more tutorials and insights, check out my YouTube channel.
Don’t forget to subscribe and stay connected for future updates.