This requirement will be most common for writing intensive jobs in journalism, content development, publishing, public relations, research and consulting.
Choosing a Writing Sample
The most important consideration when choosing a writing sample should be quality. Make sure the writing is your best and have it reviewed for content, spelling and grammar. A paper which was well received by a faculty member often makes an excellent sample. A published article, either in print or online, is another good option to use. If you have a blog, you could use a blog post.
Match the Sample to the Job
If possible, match the type of writing in your sample to the kind of writing required in your target job. For example, a journalistic styled piece or press release which tells a story would be most suitable for media-related jobs while a more academic paper might work best for a research job.
It can also be helpful to supply a piece with content similar to the topics you might write about on the job. For example, an analysis of the use of social media to promote products might be useful for a job with a public relations or marketing firm.
Start From Scratch
It's always an option to compose a piece especially geared towards a particular position if you don't already have something on hand. Just make sure it reflects your strongest writing!
Follow the Employer's Guidelines
Carefully follow any guidelines which your prospective employer provides regarding length or format. If no length is specified then you should generally stick to 2 - 4 pages of text. You can extract a segment of that length from a longer paper if it is self-contained and understandable on its own. Candidates can label their excerpt in a manner like this - introduction and conclusion from a 30 page thesis entitled "The Evolution of Gender Roles in Post Industrial America".
Bringing a Writing Sample to an Interview
If you're asked to bring a writing sample to an interview, print several copies so you have enough for whomever you might meet with. The easiest way to bring them is in a portfolio with extra copies of your resume and a list of references.
When you are applying for jobs where writing is involved, be proactive. Even if an employer hasn't requested a sample, you can bring one along on an interview or post some samples on a website and include the link for employers to access them on the resume.
On a related note, having a personal website where you can store your writing samples and other examples of your work is always a good idea.