Final Exam Information

NOTE: this website is out of date. This is the course web site from a past quarter. If you are a current student taking the course, you should visit the current class web site instead. If the current quarter's website is easily reached, it may be accessible by visiting this link instead. Please be advised that courses' policies change with each new quarter and instructor, and any information on this out-of-date page may not apply to you.

Written by Nick Troccoli, Jerry Cain and Lisa Yan, based on documents by Julie Zelenski, Sean Szumlanski and others

Overview

Thursday, December 11th, 8:30-11:30AM PDT in Dinkelspiel Auditorium

The final exam will be held during our registrar-scheduled exam time listed above, with the alternate (on Thursday, December 11th from 12:15 - 3:15PM in CoDa B90) for those who have a competing final exam or final presentation during the officially scheduled time. Unless you hold a confit with the official time, you're expected to take the exam at 8:30AM.

Logistics

The exam is a closed-book, closed-note, closed-computer, pencil-and-paper exam. The exam will include a reference sheet of essential details such as prototypes for standard library functions (e.g., strcpy, strlen, malloc), commonly used constants, as well as an additional reference sheet with the common x86-64 assembly instructions - you can find links to both further down on this page.

The exam may be a mix of short answer, multiple choice, code reading, code writing, etc. questions. Understand that we're under not obligation to mimic the structure of past exams. We promise to ask questions that fairly exercise your understanding of the material covered in the course.

Course staff will be present and available to answer any clarification questions you have while taking the final. Understand we can't answer questions beyond those asked to clarify what's being asked.


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, lectures, and readings. All material is fair game, of course, but your final will focus primarily on material not tested on the midterm (i.e., assign4 onward, lab5 onward, etc.)

We highly recommend reviewing the labs and assignments, perhaps even redoing key parts of them. Rely on the discussion froum to ask and answer questions, discuss key concepts, share techniques and aha moments, and more generally support one another.

Topics Summary

Here's the full 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, 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 implementations, strategies and tradeoffs
  • Performance and optimization: compiler optimizations, profiling

Honor Code

The exam is to be completed individually and without any assistance from a partner or other students. Adhere to the Stanford Honor Code during the exam, and report any bad behavior to a course staff member should you see any.

Exam Reference Sheets: Note: the reference sheets will be included with the exam.

C Reference Sheet Webpage | C Reference Sheet PDF
(This is the same reference sheet as on the midterm exam)

Assembly Reference Sheet
(This is the same assembly reference sheet we have used in class and labs)

Practice Materials:

Guide for how to approach and succeed on CS107 exams.

Note: some of the exams include questions covering floats, which is not included this quarter on our final exam topics.

Practice Exam 1: PDF | Solutions
This is based on the final exam from CS107 Winter 2018.

Practice Exam 2: PDF | Solutions
This is based on the final exam from CS107 Fall 2017.

Practice Exam 3: PDF | Solutions
This was the final exam from CS107 Fall 2022.

Practice Exam 4: PDF | Solutions
This was the final exam from CS107 Fall 2024.

Practice Exam 5: PDF | Solutions
This was the final exam from CS107 Winter 2025.

You can do it!