Written by Julie Zelenski
Logistics
The final exam will be held our registrar-scheduled exam time: Wednesday June 13th 12:15-3:15pm. There is no alternate exam.
We will be using two separate locations for the exam. You must attend at the location assigned to you by first letter of your last name.
- Last name begins with A-M: NVidia Aud
- Last name begins with N-Z: Gates B01 and Gates B03
If you have need of OAE accommodations, confirm arrangements by email to cs107@cs.stanford.edu. Requests for accommodations must be initiated no later than five working days in advance of the exam.
SCPD students: Local SCPD students attend the regular on-campus exam. Those outside the Bay Area should have received email from us on what you need to do for on-site proctoring arrangements. If you did not receive that email, please get in touch with us ASAP at cs107@cs.stanford.edu.
One page of notes
The final is a closed-book exam and will be given in printed form. We will provide a list of C library functions and common x86-64 assembly instructions. You may bring one double-sided sheet of paper (size 8.5" x 11") prepared with your own printed and/or hand-written notes. No additional paper materials and no electronic devices/resources are be used during the exam.
Topics
Check your rear-view mirror for the very impressive list of things you've learned in 107!
- All about C memory: C—strings, arrays, pointers, void*, pointer arithmetic, typecasts, function pointers
- 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 globals/locals/parameters
- 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
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).
Sample problems
Below are three finals+solutions from recent CS107 offerings. The exams are presented as they were given in a previous quarter. Take note that a few problems involve a topic or refer to a specific example from lab/assignment/lecture that is not comparable to this quarter. Be assured that exam content on your exam will relate to material as we covered it. For example, recent quarters studied the IEEE float representation down to the bit-by-bit encoding and manual conversion between int and float. This quarter, we focused instead on what values are representable and the behavior of floating point arithmetic. Our exam would not expect you to demonstrate manual conversion, but would expect you to show understanding of what values are representable and the operational behavior as explored in lab5/assign5.
- Final #1 (Fall 2017) This is the exam I mostly recently wrote, so is representative of my style and largely matches current course formulation.
- Final #2 (Winter 2018) This is last quarter's exam, written by Chris Gregg. Fits with current course but Chris has a different take than I do.
- Final #3 (Spring 2016) is from the last time Michael and I taught CS107 together. The CS107 course has evolved since then, so some content on this exam is mismatched to current, but thought you still might appreciate it as another example.
Work the problems in exam-like conditions for best effect. Reviewing the solutions afterward can confirm your understanding, but be wary of reading the problems side-by-side with the solution as that may mislead you into a false sense of readiness.
Further advice
Please also read my manifesto of exam advice and encouragement on how to prepare for and crush a CS107 exam. 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.
Go forth and conquer!
