From Latin 'exemplum' (example), via Old French 'essample' shortened to 'sample' — a portion taken out to represent the whole.
A small part or quantity intended to show what the whole is like.
From Old French 'essample' (example), shortened to 'sample,' from Latin 'exemplum' (example, pattern), from 'eximere' (to take out). A sample is literally something 'taken out' as representative. Key roots: eximere (Latin: "to take out").
'Sample' and 'example' are the same word — 'sample' is the shortened Norman French form, 'example' the full Latin-influenced form. They diverged in meaning but share a root.