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: 2When there is a memory wastage within the memory partition itself then it known as __________.
Option C
Fragmentation is a type of memory wastage that occurs when available memory cannot be used efficiently. It is mainly of two types:
Internal fragmentation occurs when the memory allocated to a process is larger than the memory actually required by that process. The unused space remains inside the allocated memory partition, so it cannot be easily used by another process.
For example, suppose a memory partition has a size of 10 KB, but a process requires only 8 KB. The remaining, 10-8 = 2KB is wasted inside the allocated partition. This 2 KB is called internal fragmentation.
| Internal Fragmentation | External Fragmentation |
|---|---|
| Wasted space is inside an allocated partition. | Wasted space is outside allocated partitions. |
| Usually occurs when allocated blocks are larger than required. | Occurs when free memory is divided into small scattered blocks. |
| Common with fixed-size memory partitions. | Common with variable-size memory allocation. |
Q: 3Which 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: 4The 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: 5The 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: 6If 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: 7If a memory partition of size 80k is allocated to a process of size 60k then the 20k of the partition is wasted and cannot be allocated to any process. It is called __________.
Option D
Internal fragmentation occurs when a memory partition allocated to a process is larger than the actual size required by that process. The unused space remains inside the allocated partition and cannot be allocated separately to another process.
In the given question, the memory partition has a size of 80 KB, while the process requires only 60 KB.
Therefore, the unused memory is 80KB-60KB = 20KB. This 20 KB of unused space remains inside the allocated 80 KB partition. Since it cannot be allocated to another process, it is called Internal Fragmentation.
Q: 8If 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: 9In 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: 10A 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.
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.