Stanford University
Computer Science 349: Winter 2005 - 2006

CS349 Midterm 2006, Take home exam


Due: 11:59 pm PST, Feb 10th 2005. 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 honor code to receive assistance from others or to copy material without proper attribution.

Feel free to use point form. 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. Each question is weighted equally.


  1. Software Engineering: Given the evolutionary nature of large-scale software, it is important to consider the incremental cost of adding a new feature or facility, especially given it is hard to remove a feature once added and feature addition is occurring repeatedly over many releases. Here, cost can include cost of development, on-going maintenance/support and cost in execution-time cycles and memory. Describe the key issues with understanding this incremental cost, where you think the industry is currently in understanding this, and what needs to be improved or better understood.
  2. Audit: The Dali Lama appears in the middle of a debate between using assert's vs audit and claims that the debate is bogus: His holiness argues that these are just points in the design space dimensioned on completeness of checking and frequency of invocation. In particular, asserts are typically checking more frequently (i.e. every function call) and less complete in general whereas audit is complete and less frequent. Describe to what degree he is correct and what engineering implications this might have, e.g. are there other points in this "design space" that are worth considering?
  3. Collections and Iterators: Iterator semantics could, as one choice, be specified as operating on a snapshot of the collection, logically created as a snapshot of the collection at the time the iterator is created.
    1. Assuming there are concurrent adds and deletes taking place with a collection during the lifetime of an iterator, what are the issues an application may have to deal with using this model and how does that compare to the "version"-based approach in the notes.
    2. What are the performance/efficiency issues with these semantics compared to the version-based approach.
  4. Templates: George Bush hears about C++ templates being "Turing complete", and wants to convert all US software development to "generic programming" as a competitive advantage, whereas John Kerry takes the position that template increase the "digital divide" and should be eliminated altogether. Describe and justify a sane engineering position on the use of templates, citing compelling examples and any quantitative support you have for this position.

The End