Interview Q&A / Operating Systems

BeginnerQuick answer1 min readUpdated 3 Oct 2026

What is the difference between paging and segmentation?

SHORT ANSWER

Paging divides memory into fixed-size pages invisible to the programmer; segmentation divides it into variable-size logical units like code, stack and heap. Paging causes internal fragmentation, segmentation causes external.

Explain it simply

Paging is cutting a long cloth into equal 1-metre pieces regardless of the pattern. Segmentation is cutting along the pattern: one piece for the sleeve, one for the collar, each a different size.

PointPagingSegmentation
Unit sizeFixed (page)Variable (segment)
Visible to programmerNoYes, matches program structure
Addresspage number + offsetsegment number + offset
TablePage tableSegment table (base, limit)
FragmentationInternalExternal
Sharing and protectionPer pageNatural per segment (e.g. share code)

Example

A program has a code segment, a data segment and a stack segment. With segmentation, address (2, 100) means "byte 100 of the stack segment". Each segment has its own base and limit, so the stack can grow and be protected separately from the code.

With paging, the same program is split blindly into equal pages. The hardware does not know which page is code and which is stack, though per-page permission bits still give protection.

Many real systems combine them. Older x86 systems used segmentation with paging; modern 64-bit x86 mostly uses paging, with segmentation reduced to a minimal role.

What to say in the interview

"Paging uses fixed-size pages, avoids external fragmentation and is invisible to the programmer. Segmentation uses variable-size logical segments, suffers external fragmentation, and matches how programmers think. Many systems combine both."

Common mistakes

  • Saying segmentation has no protection. Each segment has a limit and permissions.

#paging#segmentation#memory

Related questions

Practise more Operating Systems questions

Test your recall with short answers, then return to the detailed explanations when you need context.

Open Operating Systems quick answers →

Get new questions like this by email

One short email when something new and useful lands. No spam, unsubscribe in one tap.

By subscribing you agree to the Privacy Policy.