A traditional exam or quiz is part of almost every classroom, but it presents some unique problems in computer science. Many students enjoy programming because of the fact that they can make mistakes, use the feedback from the system to catch those mistakes, and then use the iterative process to improve their code. When a student is asked to code on paper, the feedback system is removed.
If you choose to do traditional quizzes, make sure to provide students with ample opportunity to demonstrate what they know without the examination being overly reliant on any one format. Multiple choice questions, true/false, short answer, and code writing are all reasonable approaches; however it is probably best not to put too much value in a quiz if a programming project can be used instead.
For material on assessment questions see the post Writing Good Assessment Questions.