Most judges require applicants to submit a legal writing sample. Be forewarned that some judges require a writing sample that has not been edited by others; at a minimum, your writing sample should be substantially self-edited.
It is less important that your writing sample be of a particular type than that it be flawless and well-written. When choosing among writing samples, keep in mind that judges are looking for work that shows legal reasoning and analysis!
If you want to use a writing sample drawn from a legal internship/clerkship, clinical or summer associate experience, you must obtain your employer's permission, and you may be required to eliminate any client-identifying information. (Note: try to avoid meeting this requirement by blacking-out the client's name or other identifiers. Instead, change names to "Client X" or "John Doe" or something similar, so as not to disrupt the flow of your sample.) It also is helpful to indicate on the face of the writing sample that you are submitting it with the permission of your employer.
If you are using a law review or journal publication, it is usually the best practice to submit a pre-staff-edited version. If, however, you submit a reprint of something that has already been published, you should also submit a different, self-edited piece. You might also want to use a brief prepared for a moot court competition.
Your writing sample ideally should be between 7 and 15 pages long. It is acceptable to use an excerpt from a longer piece, if necessary; however, if you do so, make sure you provide a cover sheet that describes important facts and the general context. If you find that editing for length will sacrifice comprehensibility, it may be best to provide a longer sample.
Finally, make sure your writing sample is free of bluebooking, typographical and grammatical errors. Judges will be relying on you to provide clear, concise, error-free work. There is no better way to derail your application than by submitting a sloppy writing sample.