CS FundamentalsVery hardGATE CS (PYQ pattern)

A buddy allocator manages 1024 KB (minimum block 16 KB, requests rounded up to powers of two; the lowest-addressed free block of the smallest sufficient size is always used and split as needed; frees coalesce buddies). Requests in order: A=100 KB, B=240 KB, C=60 KB, D=120 KB, free B, E=35 KB, free A, free C. How many free blocks exist afterwards and what is the largest of them?

  1. A. 6 free blocks; largest 256 KB
  2. B. 5 free blocks; largest 512 KB
  3. C. 5 free blocks; largest 256 KB
  4. D. 4 free blocks; largest 128 KB

Correct answer: C. 5 free blocks; largest 256 KB

Final free list (address KB, size KB) = [(0, 128), (128, 64), (256, 256), (640, 128), (768, 256)]: simulate splitting and buddy coalescing step by step.

More Operating Systems questions

Exams that ask this topic