CS 61A

Structure and Interpretation of Computer Programs, Spring 2015

Instructor: John DeNero

Midterm 2


Time: 2 Hours

The exam is closed note, except for:

  • A 1-page (front and back) hand written sheet of notes that you create yourself (it may not be shared).
  • The Midterm 1 Study Guide. A copy of this study guide will be provided with your exam.
  • The Midterm 2 Study Guide. A copy of this study guide will be provided with your exam.

Topics Covered

The exam will cover all course topics through Chapter 2.9 of Composing Programs, except for Newton's method (1.6.5), implementing lists & dictionaries (2.4.7), dispatch dictionaries (2.4.8), propagating constraints (2.4.9), and implementing classes and objects (2.6).

Particular emphasis will be given to mutable data, object-oriented programming, recursion, and recursive data (such as linked lists and trees). The topics after midtern 1 includes:

  • Data abstraction
  • Lists
  • Functional pairs
  • The sequence abstraction
  • For statements
  • Ranges
  • Strings
  • List comprehensions
  • Dictionaries
  • Dictionary comprehensions
  • apply_to_all, keep_if, and reduce
  • Linked lists (both ADT and class representation)
  • Rooted trees (both ADT and class representation)
  • Mutable data
  • Nonlocal statements
  • Identity vs. equality
  • Class statements
  • Invoking methods
  • Dot expression evaluation
  • Attribute assignment
  • Bound methods vs functions
  • Class vs instance attributes
  • Inheritance
  • str and repr strings
  • Interfaces
  • Property methods
  • Special methods
  • Type dispatching
  • Type Coercion
  • Counting calls and frames
  • Memoization
  • Orders of growth
  • Sets
  • Binary search trees

You should be prepared to answer questions that relate closely to the projects and homework assignments (not including challenge problems). You should also know how to draw an environment diagram by hand.


Past exams and solutions

Review materials and guides

Start Exam