CS 240 - Final Exam: File Systems, Distributed Systems, and Operating Systems, Exams of Software Engineering

The final exam for the CS 240 course at Stanford University's Computer Science Department. The exam is open-book but closed-laptop and consists of 15 questions worth a total of 75 points. The exam covers topics such as file systems, NFS protocol, Venti server, x86 virtualization, and optimizations for performance. The exam also includes a statement of the Stanford University Honor Code.

Typology: Exams

2011/2012

Uploaded on 05/11/2023

skips
skips 🇺🇸

4.4

(11)

222 documents

1 / 13

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS 240 - Final Exam
Stanford University
Computer Science Department
June 5, 2012
!!!!! SKIP 15 POINTS WORTH OF QUESTIONS. !!!!!
This is an open-book (but closed-laptop) exam. You have 75 minutes. Cross out the
questions you skip. Write all of your answers directly on the paper. Make your answers as
concise as possible. Sentence fragments ok.
NOTE: We will take off points if a correct answer also includes incorrect or
irrelevant information. (I.e., don’t put in everything you know in hopes of say-
ing the correct buzzword.)
Question Score
1-4 (30 points)
5-7 (25 points)
8-11 (35 points)
Total (max 75 points):
Stanford University Honor Code
In Accordance with both the letter and the spirit of the Honor Code, I did not cheat on this
exam, nor will I assist someone else cheating.
Name and Stanford ID number:
SCPD? (Yes / No)
Signature:
1
pf3
pf4
pf5
pf8
pf9
pfa
pfd

Partial preview of the text

Download CS 240 - Final Exam: File Systems, Distributed Systems, and Operating Systems and more Exams Software Engineering in PDF only on Docsity!

CS 240 - Final Exam

Stanford University

Computer Science Department

June 5, 2012

!!!!! SKIP 15 POINTS WORTH OF QUESTIONS. !!!!!

This is an open-book (but closed-laptop) exam. You have 75 minutes. Cross out the questions you skip. Write all of your answers directly on the paper. Make your answers as concise as possible. Sentence fragments ok.

NOTE: We will take off points if a correct answer also includes incorrect or irrelevant information. (I.e., don’t put in everything you know in hopes of say- ing the correct buzzword.)

Question Score

1-4 (30 points)

5-7 (25 points)

8-11 (35 points)

Total (max 75 points):

Stanford University Honor Code

In Accordance with both the letter and the spirit of the Honor Code, I did not cheat on this exam, nor will I assist someone else cheating.

Name and Stanford ID number:

SCPD? (Yes / No)

Signature:

  1. (10 points) You write a file system for a storage device that guarantees bytes are written atomically (i.e., if a crash occurs during a storage write the written byte either has the old value or the new) rather than traditional sector atomicity (where the written sector has either the old or new value). For a non-journaling Unix file system: how do you ensure that meta data (inodes, directory entries) are consistent? For a journaling FS: how would you do this? (Don’t forget the journal!) Does your job get simpler?
  1. (5 points) X and NOTX are arguing in the hallway about adding journaling to NFS. X claims this will help performance and points to a graph from a cs240 paper to justify this claim. NOTX says journaling will just add complexity and not help since you have to write everything to disk anyway. What graph is X talking about? (Hint: not in the NFS paper.) Who is more correct?
  1. (10 points) Some kid in the hall tells you the key to happiness in NFS is to store the NFS data on a Venti server and to add the Venti hash of the entire file to the file handle (which now comprises the inode number, the generation number, and the venti hash). Explain how to modify the NFS protocol so that: (1) writes by a single process work, (2) concurrent writes by two processes do something sensible and (3) when you close a file, the contents are exactly what you wrote or that of a later writer, not a mix of the two (so: close-to-open consistency where close does an atomic flush of a client’s modified data). Note: don’t use leases or other cache coherence gimmicks.
  1. (10 points) Modify the map and reduce code in the paper to implement (1) grep and (2) sort. You don’t have to put in every brace, but if the code in the appendix gives a function to use you should use it.
  1. (5 points) Haystack writes some data synchronously and some data asynchronously. Give the intuition for why either choice is made and the general approach it uses to guarantee correctness for asynchronous writes.
  1. (5 points) We’ve discussed some of the features of the x86 that make virtualization difficult. What are some that help virtualization? (Don’t include recent features like Intel VT or AMD-V that were designed to enable virtualization. If you don’t know what “VT” or “AMD-V” mean, don’t worry about it.)
  1. (10 points) You know the future. Concisely describe three optimizations you could do (and how) that would clearly give performance wins for papers from this quarter other than predicting which cache entry to evict.