Stanford University
Computer Science 349: Winter 2004 - 2005

CS349 2005 Final Exam: Take Home Exam


Due: March 18th at 5 pm. Please submit by email to cheriton at dsg.stanford.edu.

You are free to use any material, including books, course material, etc. However, you should complete the exam yourself without assistance from others. It is a violation of the house code to receive assistance from others or to copy material without proper attribution.

Feel free to use point from. Each question can be answered satisfactorily in a page of writing or less. I am primarily interested in the most key points responsive to each question.


  1. Type Structure of Programs:
    1. Professor Knowitall announces with great confidence that any use of run-time type identification (RTTI) (e.g. dynamic cast) is a failure of programming structure. Describe a key use of RTTI that you would use to challenge this statement, or argue in support of this statement if you prefer.
    2. Condeleeza Rice states: "C++ dynamic cast is just an optimization over the double-dispatch trick as arises in the visitor pattern." Describe whether this is true or false and support your conclusion.
  2. Descriptions: The String and GeometricDesc description data structures explored in the course were primarily focused on making the memory requirements of an application analyzable and acceptable. Describe some potential synergy between this objective and achieving greater processing efficiency, and also (potential) conflicts between these memory and processing objectives.
  3. Memory Management : The MemPool approach seems rather restrictive compared to the C++ capability of per-class overloading of operator new and delete with arbitrary parameters, functionality and performance. Describe why it is not actually restrictive and support this further by characterizing when, if ever, it makes sense to depart from the MemPool approach, i.e. specialized overloading of operator new/delete.
  4. Concurrency: At first glance, you might think that concurrency does not have any big issues with modularity in OOP. For instance, you can have each module just providing locking around its data structures, i.e. a simple implementation extension over a sequential version. Describe why the situation is more complicated, giving a specific example, and how that is addressed in the course material.

Thanks, The End