Midterm Part 1
This exam has been held. Its four problems are on their own page.
Tuesday, September 29, 12:30 to 1:45, in Ben Franklin 103. The exam is the first fifty minutes. The rest of the period is a discussion — nothing to prepare for it, nothing to hand in.
It is programming. Not multiple choice, not an essay, and there is no paper — you write C at the machine in front of you, compile it with gcc, and run it, exactly as you have done in every class since August. If a program of yours does not compile, you will find out during the exam rather than afterwards, which is the main reason it is written this way.
Three or four small programs. Every one of them is the size of a single A2 or A3 step — nothing on this exam is longer than something you have already written once.
You hand it in through a quiz. On Brightspace, under Quizzes rather than Assignments, there is a quiz called Midterm Part 1 with one question. You attach your .c files and your Makefile to that question, the way you attach a file to an email.
It opens only on the lab machines in Ben Franklin 103. The quiz is restricted to the room’s own network, so it will not open on a laptop or from anywhere else. Work at the machine in front of you.
Attach each program as you finish it, and press Submit once, at the end. You get one attempt, so submitting is what ends your exam — attaching a file is not, and a program that does not compile is still worth attaching. The quiz closes at 1:25, so press Submit before then.
This changed on 2026-09-27, after this page first went up: the hand-in used to be an upload like A1 through A4. The room, the work and the fifty minutes are unchanged — only where you put the files has moved.
What it covers
C without pointers. That is the boundary, and it is the whole of it:
- The command line and
gcc— [DIS] 17.1 — Unix Command Line and the Unix File System. Moving around, making a file, compiling a program and running it. - Types, expressions, conditionals and loops — [DIS] 16.2 — Input/Output (printf and scanf) and [DIS] 16.3 — Conditionals and Loops. Including
printfandscanf. - Functions, headers, and splitting a program across files — [DIS] 16.4 — Functions, and
makefrom [DIS] 17.5 — make and Makefiles. - Arrays and strings — [DIS] 16.5 — Arrays and Strings, which is this week’s reading. Indexing,
'\0', and why going out of range is undefined behavior rather than an error anything tells you about.
If Python is the language you know best, those are 1.2, 1.3, 1.4 and 1.5 — the same sections, and the exam is written so that either track works.
Chapter 2 is not on this exam. Pointers, malloc, structs, and everything that needs the * character are Part 2, which comes later in the term once we have taught them. So is anything to do with parallelism. If you have been worrying about the swap in A3 that would not swap: it is still not your problem yet.
Open book. No AI.
Open book and open notes. Dive Into Systems, this website, the man pages, and every file you have written since August — your assignments, your notes.txt, your in-class directories. Your own compiler’s error messages, obviously.
No AI and no collaboration. The course AI policy applies in full, and on an exam it is not negotiable. You work alone.
The reason the first list is so generous is the second one. Nothing on this exam is a thing you could have looked up; being allowed to look things up costs the exam nothing and removes the one kind of panic that has no educational content.
How to prepare
There is a Practice test for Midterm Part 1, Thursday, September 24, and it counts for nothing. It is built to match this one: same room, same fifty minutes, same number of programs. It is the best information you will get about where you stand while there is still time to do something about it, and the only way to get it wrong is to not be there. The one thing it does not match is the hand-in, which has since moved from an upload to the quiz described above.
Rewrite one program from each assignment, from an empty file, without opening your old answer. That is the whole of it, and it is worth more than any amount of re-reading. Recognising a correct program and producing one are different skills, and only the second one is on the exam.
Four specific ones, if you want them picked for you:
- A2’s digit counter — a loop and a variable that accumulates.
- A3’s
letter_grade— anif/else ifchain inside a function that returns a value. - A3’s three-file
numbersprogram, including theMakefile, from nothing. Type theMakefileby hand, tab and all. - Anything from A4 once it is out.
If you can only do one thing, do the three-file program. Getting a program to build out of three files you wrote yourself is the single most likely thing to cost you time on the day, because it is the one with steps that have to be done in an order.
Check your loop bounds by reading them, not only by running. A C program that indexes one past the end often prints a plausible answer anyway, so a run that looks right is not proof that it is. This is the one kind of mistake your own testing will not find for you.
If something goes wrong on the day
If a machine does not work, say so immediately rather than losing ten minutes to it. Time lost to a broken machine is given back.
If you are ill or something happens, tell me before the exam rather than after. See the syllabus for what the course does about a missed assessment; it is much easier to arrange in advance.