Written by Chris Gregg, Lisa Yan, and Nick Troccoli, based on documents by Julie Zelenski, Nick Bowman and others
Date/Time:
Wednesday, February 15th, 2023, 7-9PM, Dinkelspiel Auditorium
If you have an academic or University conflict with the midterm time, and cannot make the regularly scheduled midterm, plese send an email to Chris (cgregg@stanford.edu) to arrange an alternate exam time. Please include in your email all the possible times you are able to take the exam from Tuesday, February 14th to Thursday, February 16th. Any alternate midterm exam must be within this window.
Midterm Exam Information
The midterm will be held in Dinklespiel Auditorium from 7-9pm on Wednesday, February 15th. It will be a paper exam, so please bring pencils. We will provide scratch paper.
The midterm exam is intended to gauge your comfort and facility with the course material so far, as well as assess your mastery of the course learning objectives. Since the course topics build on each other, confirming you have a solid grasp of the foundational material now ensures you are equipped to tackle the later concepts to come in the course.
We provide the exam as a tool to take stock of where you're at and see how much you've learned in the first half of the course, as well as what work you have left to do. It also contributes a small but meaningful contribution to your course grade, which we hope will inspire you to use this checkpoint opportunity wisely!
The exam has a particular emphasis on material that was prominent in the lectures, assignments and labs.
Please make sure to thoroughly read all information contained on this page to ensure you understand the midterm logistics, requirements and restrictions.
Logistics
The exam is closed-book. You may bring a double-sided US-Letter-sized (8.5"x11") page of your own prepared notes (no magnifying equipment other than standard eyeglasses is allowed). The exam will include a reference sheet of essential details such as prototypes for standard library functions (e.g., strcpy
, strlen
, malloc
).
Course staff will be proctors at the exam to answer clarification questions.
The exam is strictly individual work.
During the exam, you may use/reference:
- a double-sided US-Letter-sized (8.5"x11") page of your own prepared notes.
- a provided reference page of essential details such as prototypes for standard library functions (e.g.,
strcpy
,strlen
,malloc
). This is included with the exam. - provided blank scratch paper (we will provide this at the exam)
You are not permitted to use any other materials, such as printouts (notes, slides, code, practice exams, etc.), other textbooks, or electronic devices (computer, iPads, Kindles, calculators, music players, etc.).
The exam may be a mix of short answer, multiple choice, code reading, code writing, etc. questions.
There are practice exams from prior quarters below.
SCPD Information
If you are an SCPD / remote student, you should have an exam monitor as per SCPD instructions. We will forward a copy of the PDF for the exam to the monitors no later than Tuesday morning. Your monitor should print out the exam for you to take, and then scan and email it back to SCPD and to me (cgregg@stanford.edu). You have the same requirements as the in-person students as far as materials (1 page of notes) and time frame (2 hours). You may take the exam during a 24 hour period surrounding the regular exam time (i.e., 7am Wednesday, PST to 7am Thursday PST. If you need to take the exam at a different time, please reach out directly to me).
Material Covered
The midterm is intended to assess your understanding of the content covered in the first half of the course. The coverage is through the topics relevant for lab4 and assign4 but not beyond (i.e., through generics, but the midterm will not cover assembly). Material on generics will be slightly less heavily emphasized than other topics as assign4 is not due until after the exam, and you are not required to have completed any of assign4 before the exam.
The priority is on material that figured prominently in the assignments, labs, lecture, and reading (this list is in order of decreasing emphasis).
We highly recommend revisiting the labs and assignments. Each of them contain post-task self-check questions at the end that you can use to review. The K&R and B&O textbooks also contain many exercises if you want additional problems to work.
We'd love to see the discussion forum come alive in helping everyone make the most of this opportunity to review what we've covered so far and rock the midterm – this is a great place to ask and answer unresolved questions, discuss conceptual issues, share techniques and materials you are finding useful as preparation, and support and encourage each other.
What To Bring
The exam is on paper. You should bring:
- Pencils and/or pens
- Your physical double-sided page of notes
Honor Code
The exam is to be completed individually and without any assistance from a partner or other students. Follow the Stanford Honor Code (see link on main course homepage) during the exam: submit only your own work, do not use unpermitted aids on the exam, and say something to the instructors or students in question to prevent any inappropriate activity conducted by others surrounding the exam.
Grading
For coding questions, the majority of the points are typically focused on the correctness of the code. However, there may be deductions for code that is roundabout, awkward or inefficient when more appropriate alternatives exist. We will reward the simple, direct approach for its good design decisions and such code will likely have fewer correctness issues, so the choice of appropriate design can have a large impact. For example, we expect you to leverage appropriate features from the standard libraries; re-implementing that functionality wastes your valuable time and introduces opportunity for error.
Note that certain problems may have certain constraints (such as only using certain material, etc.) that you must follow to earn full credit. These constraints are not intended to make things difficult; typically, we are trying to guide you in the direction of a more straightforward solution. If you disregard these instructions, you are likely to lose points, either for not meeting the problem specification and/or for errors introduced when attempting a convoluted alternative. We reserve the right to deduct points for extremely inelegant or inefficient code that dodges the spirit of the problem.
- You are not required to write
#include
statements. Please do not abbreviate any code (such as writing "x2" next to code to copy it twice). Abbreviated code will not be graded. - Pseudo-code (writing English sentences and phrases instead of code) will typically earn little to no points. For example, writing "In this part of the code, I want to open the file and read each line and print it" will not earn any points.
- You should include your answer, as well as any scratchwork, in the text area for each problem. An answer to a problem not in the designated answer pages for that problem will not receive any credit.
- Unless otherwise specified, it is fine to write helper functions to implement the required behavior.
- Style and decomposition are secondary to correctness. Unlike the assignments where we hold you to high standards in all areas, for an exam, the correctness of the answers dominates the grading. Decomposition and style are thus somewhat de-emphasized. However, good design may make it easier for you to get the functionality correct and may require less code, which takes less time and provides fewer opportunities for error. Comments are never required unless specifically indicated by a problem. When a solution is incorrect, commenting may help us determine what you were trying to do when we attempt to give partial credit.
- We are lenient on syntax. We won’t trouble you about most small syntax errors (forgetting semicolons or spaces, for example) as long as your intentions are clear. Having said that, beware that if your syntax errors cause ambiguity (e.g. very unclear curly braces), we might not get the correct meaning. Additionally, there are subtleties that matter immensely, e.g., a
int**
is just one character different thanint*
, yet there is a world of difference between the two! - The majority of the points for a problem will be reserved for grading the critical core of the code. For example, if we ask you to write a function that processes a generic array, only a tiny fraction of the points will be allocated to tasks such as initializing the counter or iterating over the right bounds, while the bulk of the points will be gained or lost in the tricky details of whether you correctly handle the
void*
s. Being off-by-one in the loop is a tiny deduction, but being a level of indirection off or applying the wrong cast is a larger issue. Be sure to focus your attention accordingly!
Downloads
Exam Reference Sheet:
Webpage | PDF
Note: the reference sheet will be included with the exam.
Practice Materials:
Guide for how to approach and succeed on CS107 exams.
Note that the practice exams below were given out after assign4 was completed, meaning they emphasized generics slightly more heavily than the midterm will.
Practice 1: PDF | Solutions
This was the midterm from CS107 Winter 2018. It was written as a 120 minute exam.
Practice 2: PDF | Solutions
This was the midterm from CS107 Fall 2018. It was written as a 110 minute closed-note paper exam.
Practice 3: PDF | Solutions
This was the midterm from CS107 Fall 2017. It was written as an 80 minute closed-note paper exam.
Extra Practice Problems: PDF | Solutions
This is a compilation of additional practice problems from CS107 Fall 2017 for the various topics covered on our midterm.
Still More Practice Problems: PDF | Solutions
These are practice problems written in Winter 2021 by a former CS107 and CS107A CA, Andrew Benson. These were given out in preparation for the open-book open-resource mid-quarter assessment given that quarter.