CS417 Exam 2

Fall 2014

Paul Krzyzanowski

    Part I – 20 points

  1. 5 points
    NFS was initially designed as a stateless file system. The design principle of many REST-based web services today is to keep the servers stateless. Explain why server state is useful in a network file system.
  2. 5 points
    What is a false deadlock and under what conditions could a false deadlock arise?
  3. 5 points
    Explain what happens in the first phase of a three-phase commit protocol.
  4. 5 points

    You have a collection of stock market summary data in the form of:

    { date, company, start_price, end_price }
    

    where the start_price is the price of the stock at the start of the trading day and the end_price is the price of the stock at the end of that day. For example: { 2014-10-29, AAPL, 106.83, 107.34 }.

    You want to find out the average daily gain (or loss) of each company from January 1, 2000 through December 31, 2014. Explain the MapReduce operations needed to accomplish this. Use C/Java style pseudocode. Feel free to use ≤ and ≥ comparisons for dates and assume that functions such as average() are available. Assume that the map function is called once for each parsed record of data and a function called emit() exists in the form emit(key, value). For reduce, assume that a print function exists that prints results. For example, print(name, result).

    Answer:

    Map function
    map(date, company, start_price, end_price) {
    	[insert your pseudocode here]
    
    

    } Reduce function reduce(key, list) { [insert your pseudocode here]

    }

  5. Part I – 80 points, 4 points each

    For each statement, select the most appropriate answer. I will give you credit for three incorrect answers.

  6. Which of the following is an example of an impure name?
    (a) Ethernet MAC address.
    (b) Email address.
    (c) Phone number.
    (d) Facebook user name.
  7. In virtual synchrony, if process A fails to contact another process, B, in the group:
    (a) Process B is removed from the group but only if it is truly dead.
    (b) Process B is removed from the group even if it is alive.
    (c) Process A will try to route the message through another group member.
    (d) Process A will revoke all copies of messages that were sent to other group members.
  8. A flush message in virtual synchrony received by a process causes that process to:
    (a) Send any unconfirmed messages to members of the group to be sure they have them.
    (b) Delete any messages that have been received but not yet delivered to applications.
    (c) Delete any messages that have been queued for sending but not yet sent.
    (d) Write in-memory data to disk to create a checkpoint for recovery.
  9. Which of the following is not an ACID property of transactions?
    (a) The transaction appears as an indivisible action.
    (b) The transaction cannot leave data in an inconsistent state.
    (c) Once a transaction commits, the results are made permanent.
    (d) The results of a transaction must eventually be made consistent across replicas.
  10. The three-phase commit protocol improves on the two-phase commit protocol in that it:
    (a) Allows each participant to acknowledge the completion of a commit.
    (b) Ensures that a majority of participants will agree to commit or abort.
    (c) Sends a commit or abort request to every single participant.
    (d) Enables the use of a recovery coordinator.
  11. The three-phase commit protocol is not resilient against:
    (a) Synchronous environments.
    (b) Asynchronous environments.
    (c) Fail-stop environments.
    (d) Fail-recover systems.
  12. When scaling systems, it is common to give up on:
    (a) Availability of the service.
    (b) Having the system tolerate partition failures.
    (c) Atomicity of changes.
    (d) Data consistency across systems.
  13. Which is not a necessary role in Paxos?
    (a) Client
    (b) Proposer
    (c) Learner
    (d) Leader
  14. A leader in Paxos:
    (a) Is the proposer that processes all incoming requests.
    (b) Load balances incoming requests among all proposers.
    (c) Assigns roles of proposer, acceptor or learner to Paxos processes.
    (d) Propagates the consensus value out to servers.
  15. To survive the simultaneous failure of P acceptors, Paxos requires:
    (a) P2 acceptors.
    (b) P+1 acceptors.
    (c) 2P acceptors.
    (d) 2P+1 acceptors.
  16. With two-phase locking, a transaction:
    (a) Obtains locks in the first phase and releases them in the second.
    (b) Uses a two-phase commit protocol to obtain locks.
    (c) Must get everyone's agreement to release a lock.
    (d) Checks if the lock is available in the first phase and gets it in the second.
  17. Two-phase locking:
    (a) Ensures that a transaction does not read uncommitted data from another transaction.
    (b) Uses separate read locks and write locks.
    (c) Ensures that transactions are serialized (isolated).
    (d) Uses a two-phase protocol to grab a lock reliably.
  18. Deadlock cannot occur if:
    (a) Each resource is given to only one process at a time.
    (b) A process is allowed to wait until a resource it needs is available.
    (c) Two-phase locking is used.
    (d) A process can access resources that another process is using.
  19. The Chandy-Misra-Hass algorithm deals with deadlock by having a process:
    (a) Send probe messages to processes that hold resources it needs.
    (b) Send its resource utilization to a central server to assemble a global wait-for graph.
    (c) Not wait on resources that a younger process is using.
    (d) Kill a process that is using a resource that it needs.
  20. The wait-die algorithm ensures there can be no deadlock by:
    (a) Having a process kill itself if it waited more than a certain amount of time.
    (b) Testing to see if there is a cycle of resource dependencies.
    (c) Disallowing a young process to wait for an old one.
    (d) Giving a process the option to wait or kill itself.
  21. NFSÕs validation refers to:
    (a) The server sending invalidation messages when content has changed.
    (b) The client comparing received data with a checksum to guard against corruption.
    (c) The client comparing file modification timestamps from the server against those of its cached data.
    (d) The client authenticating with the server.
  22. Coda improves on AFS by adding:
    (a) A stateless server for high performance.
    (b) Remote access semantics instead of whole file downloads.
    (c) Replicated read/write volumes.
    (d) File locking support.
  23. Microsoft oplocks (opportunistic locks) in SMB:
    (a) Control how a client can cache file data.
    (b) Allow clients to lock regions of a remote file.
    (c) Ensure that only one client can access a file at a time.
    (d) Enable a server to lock client operations if a file is being modified.
  24. Credit-based flow control:
    (a) Enables a server to control the rate of messages from each client.
    (b) Provides a billing infrastructure to charge clients for server use.
    (c) Is a mechanism to balance load among multiple servers.
    (d) Notifies clients of file modifications so they can update their caches.
  25. Notification servers were added to Dropbox to:
    (a) Enable clients to notify Dropbox servers that changes have been made.
    (b) Have blockservers notify metadata servers of changes.
    (c) Allow Dropbox to work with mobile devices.
    (d) Reduce database query load by not having clients poll for changes.
  26. A GFS master:
    (a) Is a central server that stores filenames along with their chunk IDs.
    (b) Stores all file contents, which are replicated among chunkservers for redundancy.
    (c) Does not store any information about files but is responsible for tracking the health of servers.
    (d) Does not store any information about files but all operations pass through it to ensure total ordering.
  27. In Bigtable:
    (a) By rows, with contiguous ranges of rows placed on different servers.
    (b) By columns, with contiguous ranges of columns placed on different servers.
    (c) Both rows and columns, with a range of rows and subset of columns on different servers.
    (d) With table cell on an arbitrary server and a master coordinating access.
  28. A reduce worker starts to process data when:
    (a) At least one map worker has completed.
    (b) The majority of map workers have completed.
    (c) All of the map workers have completed.
    (d) At least one map worker has generated a pair for that reduce worker.
Last modified March 24, 2020.
recycled pixels