Problem Statement
Explain internal and external fragmentation and give examples of each.
Explanation
Internal fragmentation happens when a process is allocated a memory block larger than it needs, leaving wasted space inside it. For example, if a block of size 100 units is given to a process needing 90, the 10 units inside are wasted. External fragmentation happens when free memory is available overall but split into small blocks so no single block is large enough to satisfy a request. For instance if free blocks of size 10,15,5 units exist but a process requests 20 units, it fails even though total free space is 30. Knowing both types helps you talk about memory management pitfalls in interviews. :contentReference[oaicite:9]{index=9}