Written by Jerry Cain and Lisa Yan, based on prior work by Nick Troccoli, Julie Zelenski and others
Date/Time:
Friday, March 20th, 3:30PM-6:30PM
Location:
The exam will be administered via BlueBook, and you're expected to take the final remotely using a personal laptop or desktop machine. You will, of course, need an internet connection in order to submit your work once you're done. Please note that we no longer have a room assignment, and that the University is mandating that the final exams be take home and must be taken remotely.
Format:
This quarter, the take-home final exam will be open notes, open book, and open network. You are free to access any static resource, and you're even permitted to access the myth machines while taking the final exam. You, however, are not permitted to communicate with anyone else while taking the exam. No email, no texting, no messaging, no exchange of information with any other people.
Logistics: The exam itself will be uploaded prior to the published start time. We will post the decryption password at 3:25pm, and we expect all submissions to be uploaded by 6:45pm.
Review Session:
Wednesday, March 18th, 12:15-3:15PM via Zoom. Details forthcoming.
Overview
If you planning to be on campus on March 20th and need a laptop for the exam, you must let us know by Friday 3/13 @ 11:59PM PST. We can provide a laptop ahead of time, and you can return it after you've submitted the exam.
The final exam will be held during our registrar-scheduled exam time: Friday, March 20, 3:30PM-6:30PM. For the final exam, there will be no alternate time, except for those with relevant official university athletics or Office of Accessible Education accommodations, so please make sure that you can attend the final exam at the specified time before enrolling in the class.
The exams are designed to assess your mastery of the course learning objectives, with a particular emphasis on material that was prominent in the lectures, assignments and labs.
The exam is open-book, open-notes, and open-internet, though you are forbidden from communicating with anyone during the exam itself. The exam will include a reference sheet of essential details such as prototypes for standard library functions (e.g., strcpy, strlen, malloc), as well as an additional reference sheet with the common x86-64 assembly instructions. We're working to provide a version of BlueBook that allows easy access to the rest of your computer.
Material Covered
The final is intended to assess your understanding of the content covered throughout the course. The priority is on material that figured prominently in the assignments, labs, lecture, and reading (this list is in order of decreasing emphasis). The topic coverage for the final exam will be comprehensive and span the entire quarter, but expect more emphasis on material covered after the midterm (i.e. >= lab5 and assign5).
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 Piazza forum come alive in helping everyone do their best on the exam – 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.
We'll also monitor Piazza during the final in case you have questions during the exam.
Topics Summary
Check your rear-view mirror for the very impressive list of things you've learned in 107!
- All about C and memory: C—strings, arrays, pointers,
void*, pointer arithmetic, typecasts, function pointers, generics, stack and heap - Data representation: bits, bytes, ASCII, two's complement integers, floating point, pointers, aggregate types (arrays and structs)
- x86-64 assembly: data access and addressing modes, arithmetic and logical ops, implementation of C control structures, call/return
- Address space: layout and purpose of text/data/stack/heap segments, handling of different variable scopes/types
- Runtime stack: caller/callee protocol, parameter passing, use of registers
- Memory and heap: stack versus heap allocation, heap allocator strategies and tradeoffs
- Performance: compiler optimizations, profiling
Logistics
-
The 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 communicate with anyone else during 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 extremely roundabout/awkward/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. 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
#includestatements on the exam. Please do not abbreviate any code on the exam (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.
Downloads
BlueBook Software: The BlueBook development team is working to create a version that's been optimized for open-book, open-note, take-home exams. We'll post updates here as updated versions of BlueBook become available.
Exam Reference Sheets: Note: the reference sheets are included as the last "problems" in the BlueBook exam. You will be provided with hard copies as well during the exam.
C Reference Sheet Webpage | C Reference Sheet PDF
Practice Materials:
Note: the practice BlueBook exam below is configured with an infinite time limit and should work with the version of BlueBook you downloaded for the midterm. You cannot close BlueBook and come back to work on the exam later - you must complete it in one sitting. You cannot submit practice exams, and you will lose your work if you do - if you'd like to check your answers, leave BlueBook open while you do so. Note that for security reasons, BlueBook disables copy/pasting into or out of BlueBook. You can copy/paste within BlueBook, however.
Guide for how to approach and succeed on CS107 exams.
Practice Exam 1: BlueBook | PDF | Solutions
Password: marigold
This is based on the final exam from CS107 Winter 2018. It was written as a 180 minute BlueBook exam (the same as this quarter).
Practice Exam 2: PDF | Solutions
This is based on the final exam from CS107 Fall 2017. It was written as a 180 minute paper exam (same as this quarter, except not using BlueBook).
Practice Exam 3: PDF | Solutions
This is based on the final exam from CS107 Fall 2018. It was written as a 180 minute paper exam (same as this quarter, except not using BlueBook).
Extra Practice Problems: PDF | Solutions