CS 334: Midterm 2 Details
Logistics
The CS 334 Midterm 2 will be an in class exam on Thursday, April 30.
- You must be present when the class begins in the section you are registered for.
- You will have 75 minutes to work on it.
- The exam be closed book, and you may not use any references.
Content
- The questions will be similar to the homework, lab and midterm questions, and they will test basic thoughts, ideas, techniques. Not minutiae.
- It will cover the material from HW 5 -- HW 8 and Labs 5 -- 8.
- There may be small code questions in ML, Java, or Scala.
Topics
The main topics to review include the following. (This is intended to be
representative of the main topics and ideas covered, but it's not exhaustive -- be sure to be familiar with everything we covered in class.)
- Scoping and Storage Management: static vs. dynamic scoping, activation records, access links, closures, and the upward funarg problem.
- Parameter Passing: pass-by-value, pass-by-reference, and pass-by-value-result (in, in-out, and out modes).
- Tail Recursion: what makes a call a tail call, and why tail-recursive functions can run in constant stack space.
- Exceptions and Control Flow: raising and handling exceptions, and how handlers are found on the call stack.
- ADTs, Objects, and Expression Hierarchies: type-case style (ML datatypes with pattern matching) vs. object-oriented style (abstract classes with methods); adding a new form vs. adding a new operation; the Visitor design pattern.
- Smalltalk and Dynamic Dispatch: object representation, method lookup, binary methods, and protocol conformance.
- Scala: case classes, pattern matching, and traits; classes vs. traits; mixing in multiple traits and linearization; the diamond problem.
- C++: object representation, method lookup, inheritance, etc.
- Subtyping: definitions for different languages, function-type subtyping (covariant return, contravariant argument)
Accomodations
If you have accomodations, please coordinate with me before Friday, April 24.