Memory Management & Paging Questions with Answers

46 practice questions on Memory Management & Paging (Operating Systems) with answers and step-by-step solutions. Try 10 samples below, then practise all 46 free in the AptiNest app.

Sample questions

Question 1Easy

With a page size of 1 KB, what are the page number and offset of logical address 5000?

  1. Page 4, offset 1000
  2. Page 4, offset 904
  3. Page 3, offset 904
  4. Page 5, offset 0

Answer: B. Page 4, offset 904

Explanation

5000 / 1024 = 4 remainder 904
(4 x 1024 = 4096;
5000 - 4096 = 904).

Step-by-step solution

  1. Page size is 1 KB = 1024 bytes.
  2. Logical address 5000 divided by 1024 gives page number 4.
  3. Remainder is 904, which is the offset.
  4. Page number is 4 and offset is 904.
  5. Final answer: Page 4, offset 904.

Why the other options are wrong

  • A. Offset 1000 is wrong; 5000 minus 4 pages of 1024 bytes leaves 904, not 1000.
  • C. Page 3 is wrong; page 3 covers 3072 to 4095, while 5000 falls in page 4.
  • D. Page 5 starts at 5120, which is past address 5000, so 5000 is not at offset 0 of page 5.

Tip: Divide address by page size; quotient is page number, remainder is offset.

Question 2Easy

In segmentation, a logical address consists of:

  1. A page number and a frame number
  2. A base and a limit
  3. Only a physical address
  4. A segment number and an offset

Answer: D. A segment number and an offset

Explanation

The segment number indexes the segment table to get base and limit; the offset is checked against the limit and added to the base.

Step-by-step solution

  1. Logical address has two parts: segment number and offset.
  2. Segment number points to the segment in the segment table.
  3. Offset is added to the base address from the segment table.
  4. This gives the physical address in memory.
  5. Final answer: A segment number and an offset.

Why the other options are wrong

  • A. A page number and a frame number belong to paging; segmentation uses a segment number and an offset.
  • B. A base and a limit are fields of the segment table, not the two parts of a logical address.
  • C. A logical address is not a physical address; the CPU generates a segment number and offset, which are then translated.

Question 3Easy

In paging, physical memory is divided into fixed-size blocks called:

  1. Segments
  2. Frames
  3. Pages
  4. Sectors

Answer: B. Frames

Explanation

Logical memory is divided into pages of the same size as the physical frames.

Step-by-step solution

  1. Physical memory is split into fixed-size blocks.
  2. These blocks are called frames in paging.
  3. Logical memory is divided into pages matching frame size.
  4. Frames are the fixed-size blocks of physical memory.
  5. Final answer: Frames.

Why the other options are wrong

  • A. Segments are variable-sized logical units, not fixed-size blocks of physical memory.
  • C. Pages are fixed-size blocks of logical memory; the fixed blocks of physical memory are frames.
  • D. Sectors are units on a disk, not the memory blocks used in paging.

Question 4Easy

Which memory management scheme suffers from external fragmentation?

  1. Inverted page tables
  2. Fixed-size frame allocation
  3. Paging
  4. Segmentation

Answer: D. Segmentation

Explanation

Segments have variable sizes, so free memory can become split into many small holes between segments.

Step-by-step solution

  1. Segmentation divides memory into variable-sized segments.
  2. Free memory spaces are left between segments as they are not contiguous.
  3. These scattered free spaces cannot be used for new segments, causing external fragmentation.
  4. External fragmentation happens when free memory is not enough to satisfy a request.
  5. The correct answer is Segmentation.

Why the other options are wrong

  • A. Inverted page tables are a paging design with fixed-size frames, so they do not suffer external fragmentation.
  • B. Fixed-size frames avoid external fragmentation, because any free frame can hold any page.
  • C. Paging uses fixed-size frames, so it suffers from internal fragmentation, not external fragmentation.

Tip: Remember: Segmentation causes external fragmentation due to variable segment sizes.

Question 5Medium

Paging makes sharing code between processes easy because:

  1. Segments are always contiguous
  2. Each process gets its own private copy of every shared page, so no process can modify another copy
  3. Several page tables can point to the same frames holding reentrant code
  4. Pages are never in memory

Answer: C. Several page tables can point to the same frames holding reentrant code

Explanation

Read-only (reentrant) code such as a shared library can be mapped into many address spaces at once.

Step-by-step solution

  1. Paging lets several page tables map the same physical frames.
  2. If the shared code is reentrant, the same frames can be used by all processes.
  3. So option C is correct.

Why the other options are wrong

  • A. Contiguous segments are about segmentation, not paging sharing.
  • B. A private copy per process means no sharing at all.
  • D. Pages are usually in memory when they are used.

Tip: Shared code = same frames mapped in many page tables.

Question 6Medium

The page size is 1 KB. Logical address 3085 lies in a page that is mapped to frame 7. What is the physical address?

  1. 3085
  2. 10253
  3. 7168
  4. 7181

Answer: D. 7181

Explanation

Page number = 3085 div 1024 = 3, offset = 3085 mod 1024 = 13.
Physical address = 7 x 1024 + 13 = 7181.

Step-by-step solution

  1. Page size is 1 KB = 1024 bytes.
  2. Logical address 3085 divided by 1024 gives page number 3.
  3. Offset is 3085 mod 1024 = 13.
  4. Frame number is 7, so physical address = 7 * 1024 + 13 = 7181.
  5. Final answer: 7181.

Why the other options are wrong

  • A. 3085 is the logical address; the physical address is frame 7 times 1024 plus the offset 13, which is 7181.
  • B. 10253 would be frame 10 plus offset 13; the page is frame 7, so the physical address is 7181.
  • C. 7168 is only the start of frame 7; the offset 13 must be added, giving 7181.

Question 7Medium

Compaction solves external fragmentation, but it is only possible when:

  1. Addresses are bound at compile time
  2. Processes never perform I/O
  3. Relocation is dynamic (done at execution time)
  4. The system uses no MMU

Answer: C. Relocation is dynamic (done at execution time)

Explanation

Moving processes requires updating their base registers, which works only with execution-time binding.

Step-by-step solution

  1. Compaction moves processes in memory to join free holes.
  2. Moving a process is only safe when its addresses can be relocated at run time.
  3. So compaction needs dynamic relocation, option C.

Why the other options are wrong

  • A. Compile-time binding fixes addresses, so processes cannot be moved.
  • B. I/O has no bearing on whether compaction is possible.
  • D. Without any relocation support, compaction cannot happen.

Tip: Compaction needs run-time relocation.

Question 8Medium

TLB lookup takes 20 ns and a memory access 100 ns, with a single-level page table. What TLB hit ratio gives an effective access time of 140 ns?

  1. 75%
  2. 90%
  3. 80%
  4. 60%

Answer: C. 80%

Explanation

EAT = h(120) + (1 - h)(220) = 220 - 100h.
Setting 220 - 100h = 140 gives h = 0.8.

Step-by-step solution

  1. With a hit, time is TLB + one memory access = 20 + 100 = 120 ns.
  2. With a miss, time is TLB + page-table access + data access = 20 + 100 + 100 = 220 ns.
  3. Effective time = 120h + 220(1 − h) = 220 − 100h, where h is the hit ratio.
  4. Setting 220 − 100h = 140 gives h = 0.8, so 80%, option C.

Why the other options are wrong

  • A. 75% gives 145 ns, not 140 ns.
  • B. 90% gives 130 ns, not 140 ns.
  • D. 60% gives 160 ns, not 140 ns.

Tip: EAT = hit × hit time + miss × miss time; solve for the unknown.

Question 9Hard

Segmentation with paging (as in classic x86) combines:

  1. Fixed partitions with best fit
  2. Contiguous allocation of each segment with swapping of whole processes
  3. Two different TLBs for each process
  4. A logical view of segments with paging to avoid external fragmentation

Answer: D. A logical view of segments with paging to avoid external fragmentation

Explanation

Segments give a programmer-friendly structure and protection; paging each segment removes the need for contiguous memory.

Step-by-step solution

  1. Segmentation gives a logical program view.
  2. Each segment is divided into pages.
  3. This avoids external fragmentation.

Why the other options are wrong

  • A. Unrelated.
  • B. This is plain segmentation with swapping.
  • C. The scheme does not need two TLBs.

Question 10Hard

A 32-bit system uses two-level paging with 4 KB pages and 4-byte entries, and each second-level page table fills exactly one page. How is the virtual address split?

  1. 12 bits outer, 8 bits inner, 12 bits offset
  2. 8 bits outer, 12 bits inner, 12 bits offset
  3. 16 bits outer, 16 bits offset
  4. 10 bits outer index, 10 bits inner index, 12 bits offset

Answer: D. 10 bits outer index, 10 bits inner index, 12 bits offset

Explanation

Offset = log2(4096) = 12 bits.
A page holds 4096/4 = 1024 entries, so the inner index is 10 bits, leaving 32 - 22 = 10 bits for the outer index.

Step-by-step solution

  1. Page size 4 KB gives a 12-bit offset.
  2. A page table fits one page: 4096 / 4 = 1024 entries.
  3. 1024 entries means 10 bits for the inner index.
  4. Remaining 32 - 12 - 10 = 10 bits for the outer index.

Why the other options are wrong

  • A. Swaps the splits and uses 8 bits that do not match 1024 entries.
  • B. An inner index of 12 bits would need 4096 entries per table.
  • C. This is single-level paging, not two-level.

Tip: Index bits = log2(page size / entry size).

Practise all 46 questions free

The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.

Open this topic in the app →

Related topics

See all Operating Systems topics · All topics