đď¸ââď¸ Follow this link for midterm practice problems. đđżââď¸
Exam Logistics
The CS106B midterm exam is coming up soon. It will be held on Monday, February 10th from 7:00PM â 10:00PM, with locations divvied up by last (family) name:
A - H
: Go to Bishop AuditoriumI - S
: Go to Hewlett 200T - Z
: Go to Hewlett 201
The exam will be three hours long. It's closed-book, closed-computer, and limited-note. You can bring a single, double-sided, 8.5â Ă 11â sheet of notes with you when you take the exam. We've seen all sorts of notes sheets in the past. Some students choose to write down important code patterns and idioms. Others include sample code from their assignments so that they can use them as a reference. We've even seen sheets of paper covered in inspirational messages. Do whatever works best for you â the whole point of the notes sheet is to be useful!
Note: We will provide you a reference sheet containing basic syntax of how to use different container types at the exam itself. This is in addition to the one sheet of notes you bring with.
The topic coverage for the exam is the material from Lectures 00 â 09 (basic C++ up through but not including recursive backtracking) and the material from Assignment 0 through Assignment 3, inclusive. Notice that you are responsible both for the material from lectures and from the assignments, so you should be prepared to answer questions about topics that came up purely on the coding assignments (say, using the debugger, struct
s, etc.). Topics from later in the course (recursive backtracking, big-O notation, and onward) will not be tested on this exam. We will not test you on anything that appears purely in the section handouts or purely in the textbook, though those are excellent resources to draw from when studying.
In terms of the exam format â you should expect the exam to (probably) be four to six questions long, with a mix of short answer questions, multiple-choice questions, and coding questions.
Coding on Exams
During the exam, you will be asked to write code without having the ability to run it. This is a fundamentally different experience than writing code in Qt Creator. Specifically:
-
You will not have a compiler that can point out syntax errors.
-
You canât run the code, tweak it, and revise it until it works.
-
You canât step through your code in a debugger.
This means that the process by which youâll need to problem-solve is different. Youâll need to map out where youâre going a bit more than what youâre used to doing in Qt Creator, and youâll need to be comfortable switching from a high-level idea to something more concrete. Additionally, youâll need to be more detail-oriented than when youâre using Qt Creator, since there isnât going to be a compiler to catch your errors for you.
The flip side of this is that we wonât be evaluating your code using the standard of âdoes it compile, run, and work flawlessly?â If we did that, chances are most people would get zero points because a single misplaced brace or stray semicolon would derail everything. Instead, weâll be asking questions like these:
-
Do you demonstrate a solid command of the C++ syntax weâve covered so far?
-
Do the approaches youâve taken to the demonstrate a good understanding of the problem-solving strategies weâve talked about so far?
-
Is your code well-structured in a way that shows a facility with breaking larger problems down into smaller pieces?
-
etc.
So, for example, a single missed semicolon or something like that is probably not going to lead to any point deductions, but using the wrong recursive strategy in a recursion problem or the wrong container type in a question on collections would be a more serious concern.
In the context of an exam, we wonât be grading for style at the same level as what weâd be looking for on the assignments â we understand that weâre essentially grading a first draft. However, you should still aim to make your code easy to read. For example:
-
Please use descriptive variable and function names. Single-letter variable names (or worse, single-letter function names) make it significantly harder to understand your code.
-
Please properly indent your code. This is especially important in the event that you forget curly braces somewhere and we need to make an educated guess as to what you intended to do.
-
Comment your code to clarify intent, though function and file comments won't be required.
There are a few details we donât care about, so letâs save you some time:
-
You donât need to add
#include
statements at the top of your code. Assume theyâre all there. -
You donât need to write function prototypes. You have more important things to worry about. đ
Preparing for the Exam
There are a number of ways that you can prepare for this upcoming exam. Here is our recommendation of what you should do to get into the best shape that you can.
-
Work through practice problems. The best way to prepare for this exam is to work through practice problems. We recommend checking out our searchable practice problem database, which has a large number of problems with solutions and starter files you can use to check your work. Note that some of the problems there focus on topics we haven't covered yet, though they'll clearly be tagged as such.
When youâre working through those problems, donât just hand-write things and call it a day. Youâll want to make sure that you actually got things working. So download a blank set of starter files from the course website, type up your solution, and try running it on some sample test cases. If things work, great! If not, try debugging your code and see if you can fix it. If youâre still stuck, no worries! Thatâs a great indicator that you should ping your SL or drop by the LaIR to get some help.
-
Review IG feedback and make sure you understand it completely and unambiguously. We hold interactive grading sessions on the assignments for a good reason â itâs a chance for someone with more coding experience than you (your section leader) to offer their advice and insights about how you can do a better job in the future. If you havenât yet done so, take some time to review the feedback you received. If there are suggestions of the form âtry doing it this way next time,â take a few minutes and actually go do it the other way. If there are stylistic points that theyâve pointed out to you, great! Go patch up your code to meet those style guidelines.
And hey, what should you do if you find something that you donât understand? Ping your SL and ask for some clarification!
-
Keep the SLs in the loop. As you're studying, please take the initiative to ask us questions when you have them. If you're not sure about how or why a certain piece of code works, or why a certain piece of code doesn't work, or why a certain concept works a certain way, etc., go on EdStem or stop by the LaIR and ask us a question. If you worked through any practice problems (section handouts or practice exams), ask your section leader to review your answers and offer polite but honest feedback on how you did and what you need to work on. You can also visit office hours if youâd like!
Exam Policies
We want to be transparent about our grading philosophy for exams and our exam policies. Here's a quick rundown of some of the frequently asked questions about CS106B exams.
-
Do you give partial credit? We do award partial credit on the exams for answers that are on the right track but contain errors. Because you're allowed to bring a notes sheet with you to the exam, we generally do not award partial credit for answers that just consist of a lot of code copied from lecture, section handouts, etc. The best way to earn partial credit on the problem is to make a good effort to solve it, and to do so in a way that shows you understand the underlying methodology weâve been teaching.
-
Can I write more than one answer to a problem? No, please do not do this. if you start writing out an answer to a problem and realize that it is incorrect, please cross it off so that we don't accidentally grade it. If you put down multiple answers to a question, we will grade whichever answer gives you the fewest number of points. This policy is in place to prevent âshotgunningâ down multiple answers with the hope that one of them will work.
-
Is pseudocode okay? We generally discourage people from writing pseudocode on an exam. It is better to just write real C++ code, or to at least outline in C++ what you would be doing. You should not expect to receive much, if any, partial credit for writing pseudocode.
Good luck on the exam!