This course will have two midterm examinations and one final examination. The final examination is cumulative. Review Sets are provided to help you stay on track and study for the examinations.

These Review Sets are not graded assignments. Instead, they serve as a structured system for students to evaluate their mastery of the material and to prepare for the written examinations. The instructor and the teaching assistants will be happy to go over Review Set answers during office hours.

- Review Set 1 — regular languages and finite automata
- Review Set 2 — context-free grammars
- Review Set 3 — grammars and Earley parsing
- Review Set 4 — type checking
- Review Set 5 — runtime organization and operational semantics
- Review Set 6 — optimization
- Review Set 7 — garbage collection and exceptions

The teaching assistants have been instructed *not* to answer
open-ended "please do this review problem for me" questions. You must
present evidence that you have tried the problem in some manner.

You are allowed to bring two paper-sides of notes (either one page, front and back or two fronts). You may laser-print them using some micro font if you like, but it may not really help you: you'll spend much of your time squinting and looking up information on your cheat sheet.

The exams are *not* open book. You may not use electronic devices
of any kind.

Exam 1 covers *all* material referenced in class or on the course
website before the date of the exam (Thursday February 18th). Notably, that
includes the Tuesday February 16th lecture, Review Sets 1 and 2, PA1
through PA3, and all non-optional readings (including video "readings", etc.)
associated with those days.

- Exam 1 from LDI in 2016 — with answer key
- Exam 1 from CS 4610 in 2015 — with answers for practice
- Exam 1 from CS 4610 in 2015 — blank for practice

Reminder: LDI and Legacy grading students take exactly the same exam.

Exam 2 covers *all* material referenced in class or on the course
website starting with Tue Feb 23 (Code Generation)
and ending Thu Apr 21 (Language Security).
Notably, that also includes PA4, PA5, Review Sets 3+, and all
non-optional readings (including video "readings", etc.) associated with
those days.

- Exam 2 from LDI in 2016 — with answer key
- Exam 2 from CS 4610 in 2015 — with answers for practice
- Exam 2 from CS 4610 in 2015 — blank for practice

Reminder: LDI and Legacy grading students take exactly the same exam.

The Language Design written final exam is cumulative a take-home essay exam. The final exam is open book. (In some semesters no written final examination is given. In such semesters student final grades are out of 100-X points rather than 100; see the syllabus for the breakdown.)

In general, all of the topics covered in the course (either in lecture, in
the reviews sets, in the programming assignments *or* in the
required reading) are fair game. The following list of topics is not
necessarily exhaustive (although it is close); you are responsible for all
of the material.

- Big Topics (will be worth more points)
- Basic Blocks, Local Optimizations, Dataflow Analysis
- Context-Free Grammars
- Earley Parsing
- Finite Automata
- Operational Semantics
- Security
- Type Checking, Typing Rules, Typing Judgments

- Average Topics
- Automatic Memory Management
- Debuggers and Profilers
- Exceptions and Error Handling
- Lexical Analysis
- Linking, Loading and Shared Libraries
- Parsing, Derivations, Ambiguity
- Scoping

- Small Topics (will be worth fewer points)
- Functional Programming
- Game Theory
- Multi-Language Projects
- Quantum Computing

Within the large topics of Typing and Opsem, "basic questions" (e.g., "what
is operational semantics?") will be worth proportionally more points than
"advanced questions" (e.g., "give an opsem rule for this new pyscho
`for` loop").

The "big" topics won't necessarily be huge parts of the exam time-wise or space-wise, they'll just be worth more points. For example, it's not clear that there are massive detailed questions we can ask about each such topic, but whatever we do ask will be weighted heavily.

- Berkeley CS 164 - Spring 2006 - Midterm 1
- Berkeley CS 164 - Spring 2004 - Midterm 1
- Berkeley CS 164 - Spring 2003 - Midterm 1 (Solutions)
- Berkeley CS 164 - Spring 2002 - Midterm 1 (Solutions)
- Berkeley CS 164 - Spring 2001 - Midterm 1 (Solutions)
- Berkeley CS 164 - Fall 2000 - Midterm 1 (Solutions)
- Berkeley CS 164 - Spring 2000 - Midterm 1 (Solutions)

- Berkeley CS 164 - Spring 2006 - Midterm 2 (Solutions)
- Berkeley CS 164 - Spring 2003 - Midterm 2 (Solutions)
- Berkeley CS 164 - Spring 2001 - Midterm 2 (Solutions)
- Berkeley CS 164 - Fall 2000 - Midterm 2 (Solutions)