LearnFrenzy
Sign in Take a free test

Operating Systems · Topic 6 of 11

Memory Management and Paging: questions with answers

Logical vs physical addresses, contiguous allocation (first, best, worst, next fit), fragmentation, paging and address translation, page-table size, TLB and effective access time, multilevel and inverted page tables, segmentation and the buddy system.

Questions
45
Timed sets
3
Answers run or computed
24
Your accuracy
–

What this topic covers

9 subtopics
  • Paging11
  • Page tables8
  • TLB6
  • Contiguous allocation5
  • Fragmentation4
  • Segmentation4
  • Addresses3
  • Allocators3
  • Swapping1
  • Beginner 15
  • Intermediate 15
  • Advanced 15

About this topic

Memory-management questions are mostly arithmetic on powers of two: split an address into page number and offset, size a page table, compute the effective access time with a TLB, or place requests with first, best and worst fit. Partitions are drawn to scale here, page and segment tables are shown as tables, and every number was computed by a program. 1 KB = 1024 bytes throughout.

Free preview

Sample questions

Try each one first, then open the answer for the explanation and why the other options are wrong.

Question 1 Contiguous allocation Beginner Practice Answer computed

Requests arrive in the order shown. With first fit, which hole does each request use? (Holes are named by their original size; a used hole shrinks.)

Free partitions (in order), sizes in KBRequests in order: 212 KB, 417 KB, 112 KB, 426 KB
212→300, 417→500, 112→200, 426→600
212→500, 417→600, 112→500, 426 waits
212→600, 417→500, 112→600, 426 waits
212→500, 417→600, 112→200, 426→300
Show answer and explanation
Correct answer B

Explanation

212 takes the first hole that fits (500, leaving 288). 417 skips 100, 288, 200 and 300 and takes 600 (leaving 183). 112 fits in the 288 left of the 500 hole. 426 fits nowhere: the largest hole is now 300.

Why the other options are wrong

  • AThat is best fit.
  • CThat is worst fit.
  • D112 fits in the earlier 288 remainder, and 426 does not fit in 300.
Question 2 Page tables Intermediate Practice Answer computed

32-bit logical addresses, 4 KB pages and 4-byte page-table entries. How large (in MB) is a single-level page table for one process?

The answer is a number – work it out, then open the solution.

Show answer and explanation
Correct answer 4

Explanation

2²⁰ entries × 4 bytes = 4 MB per process – a strong reason for multilevel page tables, which only allocate the parts in use.

Question 3 Page tables Advanced Practice Answer computed

48-bit virtual addresses, 4 KB pages and 8-byte page-table entries; every page-table node fills exactly one page. How many levels of page tables are needed?

The answer is a number – work it out, then open the solution.

Show answer and explanation
Correct answer 4

Explanation

4096 / 8 = 512 = 2⁹ entries per node, so each level resolves 9 bits. (48 − 12) / 9 = 4 levels – exactly x86-64's four-level paging. 57-bit addresses need a fifth level.

42 more questions in the timed setsSame format as the samples, with a timer, a question palette and a full review at the end.
Start practising

Operating Systems

All 11 topics

Topics, levels and full mocks
  1. 01 OS Basics and System Calls45 questions · 3 levels
  2. 02 Processes, Threads and fork()45 questions · 3 levels
  3. 03 CPU Scheduling Algorithms45 questions · 3 levels
  4. 04 Process Synchronization and Semaphores45 questions · 3 levels
  5. 05 Deadlocks and Banker's Algorithm45 questions · 3 levels
  6. 06 Memory Management and Paging45 questions · 3 levels
  7. 07 Virtual Memory and Page Replacement45 questions · 3 levels
  8. 08 File Systems and Disk Scheduling45 questions · 3 levels
  9. 09 Threads and Concurrency in Code45 questions · 3 levels
  10. 10 Linux Commands and Shell45 questions · 3 levels
  11. 11 GATE-Style OS Questions (MSQ & NAT)45 questions · 3 levels

Search LearnFrenzy

Esc

Quick links