These are closed-book, closed-note exams, done with pencil and paper so you do need to be able to write basically syntactically correct Java code. However, we won't be picky about semi-colons and such on code that's not going through a compiler. We won't be checking style per se. That said, your indentation and curly brackets should make the block structure of your code clear. Also, using good variable names will help you (as well as us) understand what you are trying to do in your code. (We understand that with time constraints you won't want to use very long variable names.)
Note: No prepared solutions available. For those problems whose answers you are unsure of after you have worked the problem, and even after looking up the relevant material, you can go over them with your study group, or get help in staff office hours. Also, we are holding a review session a few days before the exam where we will go over problems by request. (Details will be posted on piazza soon.)
Note: Occasionally there is a mistake on an exam (or solution) whose correction was announced at the exam; they don't tend to get fixed on these documents later since I don't reuse exams.
Reviewing an old exam and its solution is not a very effective way to prepare for an upcoming exam. A better way is to take the sample exam under exam-like conditions: closed book, closed note, with a time limit. Once you have completed the exam you can use the posted solution, if available, to check your answers. For those problems whose answers you are unsure of after you have worked the problem, and even after looking up the relevant material, you can go over them with your study group or get help in staff office hours or open lab hours.
Another general hint about these problems: it may help to think about these problems as working from right to left on their input, because they may be doing some work on the way back from the recursive call. For example, one way to solve stringClean is to create the new string from the right to the left, i.e., appending a single character to the front of a string returned from a recursive call. Alternatively, a tail-recursive solution with a helper function could construct the new string from left to right.
Basic Linux/Unix shell material will also be on the exam. Such questions will be based on material from lab 1 and other tidbits from lecture, labs, and assignments (e.g., wildcards, input redirection). Recall that there is a Linux command summary linked from the Documentation page (you are not responsible for everything in that Summary).
Note: Occasionally there is a mistake on an exam (or solution) whose correction was announced at the exam; they don't tend to get fixed on these documents later since I don't reuse exams.
Some of the following sample exams also have solutions provided. Reviewing an old exam and its solution is not a very effective way to prepare for an upcoming exam. A better way is to take the sample exam under exam-like conditions: closed book, closed note, with a time limit. Once you have completed the exam you can use the posted solution, if available, to check your answers. For those problems whose answers you are unsure of after you have worked the problem, and even after looking up the relevant material, you can go over them with your study group or get help in staff office hours or open lab hours.