pk.org: CS417/Exams/Old

CS 417 Exam 2

Fall 2023

Paul Krzyzanowski

4 POINTS EACH - For each statement, select the most appropriate answer.

  1. Which mutual exclusion algorithm has the benefit that processes do not need to know of any other group members?
    (a) Centralized.
    (b) Token ring.
    (c) Lamport.
    (d) Ricart & Agrawala.
  2. What is a key difference between Lamport's mutual exclusion algorithm and the Ricart and Agrawala algorithm?
    (a) Lamport's algorithm uses a logical clock, while Ricart and Agrawala's uses physical clocks.
    (b) Lamport's algorithm is token-based, while Ricart and Agrawala's algorithm is not.
    (c) All processes immediately acknowledge a request in Lamport's algorithm, but not always in Ricart and Agrawala.
    (d) Lamport's algorithm relies on a coordinator, while Ricart and Agrawala is distributed.
  3. Raft uses randomized timers in its election algorithm to:
    (a) Give every process a fair chance at becoming the leader.
    (b) Minimize the chance of no candidates getting enough votes.
    (c) Randomly choose one of several candidates as the leader in the case of a split vote.
    (d) Ensure that two or more leaders will never be chosen.
  4. One advantage the Chang & Roberts algorithm has over the Ring election algorithm is:
    (a) It does not require all group members to participate in the election.
    (b) In some cases, it may stop extra election messages from circulating completely around the ring.
    (c) It always selects the process with the highest process ID as the leader.
    (d) It avoids choosing multiple leaders if a network partition exists.
  5. A Raft follower recovers lost log entries by:
    (a) Sending an RPC to the leader with a list of missing entries.
    (b) Contacting any replica to request missing entries.
    (c) Rejecting an AppendEntries RPC from the leader.
    (d) Contacting the leader to request a copy of the log.
  6. Which mutual exclusion algorithm does Chubby implement to support client lock requests?
    (a) Centralized.
    (b) Token ring.
    (c) Lamport.
    (d) Ricart & Agrawala.
  7. Which file system provides read/write performance that is as fast as a local file system?
    (a) AFS
    (b) GFS
    (c) NFS
    (d) SMB
  8. Which of the following Linux system calls has a corresponding remote procedure call in the original NFS interface?
    (a) open (open a file).
    (b) lseek (set the read/write offset in a file).
    (c) close (close a file).
    (d) unlink (delete a file).
  9. What technique does NFS use to avoid having a client read stale data?
    (a) Callbacks.
    (b) Timestamp validation.
    (c) Oplocks/leases.
    (d) Multi-versioning.
  10. A client modification log (CML) is used in Coda:
    (a) For a server to send updates to a client that has reconnected to the network.
    (b) For a server to keep track of the current set of connected clients.
    (c) For a client to track file changes so it can roll back to previous versions.
    (d) For a client to track the files it modified while disconnected
  11. The purpose of oplocks is to:
    (a) Allow a client to cache or delay sending data for file operations when possible.
    (b) Prevent other clients from accessing a file.
    (c) Restrict the types of operations another client can perform on a shared file.
    (d) Allow changes to a file to be propagated to clients holding cached data.
  12. The Google File System (GFS) writes files in two phases. What are they?
    (a) Lock access to the file across all replicas in phase one and write the data in phase two.
    (b) Get a unique sequence number in phase one and write the data to all replicas in phase two.
    (c) Write the data in phase one and propagate the changes to replicas in phase two.
    (d) Upload data to all replicas in phase one and add it to the file in phase two.
  13. One architectural design common to both Dropbox and the Google File System is:
    (a) They both store file metadata on different servers than file data.
    (b) They are both optimized to manage a relatively small number of huge files.
    (c) They both support clients functioning in disconnected mode.
    (d) They both allow different levels of replication to be specified on a per-file basis.
  14. In a one-dimensional implementation of CAN (Content Addressable Network) with no replication, each node needs to know how to reach this many nodes:
    (a) 1
    (b) 2
    (c) 4
    (d) 6
  15. What is the purpose of a finger table in Chord?
    (a) To keep track of all the nodes in the network.
    (b) To maintain a list of objects stored across all nodes.
    (c) To efficiently route queries to the correct node in the network.
    (d) To balance the storage load among the nodes in the network.
  16. Amazon's Dynamo DHT identifies possible conflicts to updates of an object across multiple replicas via:
    (a) Physical timestamps and synchronized clocks.
    (b) Lamport timestamps.
    (c) Vector clocks.
    (d) Version numbers.
  17. What is the primary function of the Domain Name System (DNS)?
    (a) To convert domain names into a route to the destination address.
    (b) To translate human-friendly domain names into IP addresses.
    (c) To provide an administrative framework that ensures that there is at most one unique name for each IP address.
    (d) To allow a host on the Internet to query the list of available services that another host offers.
  18. What is the main advantage of using consistent hashing in a distributed hash table (DHT)?
    (a) It enhances security since only the hash of the key, and not the key itself, is stored in the table.
    (b) It reduces the overall storage requirements.
    (c) It ensures that a key will always hash to the same value.
    (d) It minimizes the number of keys that need to be reassigned when nodes join or leave the network.
  19. Which of the following is not an ACID property?
    (a) Distributed - a single transaction is distributed among a set of systems.
    (b) Consistent - data cannot be left in an inconsistent state.
    (c) Isolated - transactions cannot use intermediate results of other transactions.
    (d) Atomic - transaction appears indivisible.
  20. The two-phase commit protocol relies on:
    (a) Failed participants remaining out of the group.
    (b) A participant in the transaction taking over for a failed participant.
    (c) Failed participants restarting and then starting the transaction from the start.
    (d) Failed participants restarting and restoring their state to the point where they died.
  21. Eric Brewer's CAP Theorem states that:
    (a) You cannot have consistency, availability, and partition tolerance in a shared data system.
    (b) Commit protocols are inherently flawed.
    (c) Transactional concurrency can be increased by using leases instead of locks.
    (d) Transactional concurrency can be increased by not using locks.
  22. An advantage of the three-phase commit protocol over the two-phase commit protocol is:
    (a) It keeps a write-ahead log to enable undoing the effects of a transaction.
    (b) It allows some sub-transactions to commit and others to abort instead of forcing all participants to abort.
    (c) A recovery coordinator can find the state of the protocol by querying just a single participant.
    (d) It gives a sub-transaction a second chance to decide to commit even if it initially stated it needs to abort.
  23. The strong strict two-phase locking (SS2PL) protocol:
    (a) Improves concurrency over two-phase locking (2PL).
    (b) Ensures that transactions do not read uncommitted data.
    (c) Allows transactions to release a lock as soon as they have no need for further access to the resource.
    (d) Ensures that locks are requested in a way that deadlock cannot occur.
  24. How does multiversion concurrency control (MVCC) improve performance in a stored data system?
    (a) It allows a transaction to undo any changes it made if it has to abort.
    (b) By increasing the number of write operations that can be performed concurrently.
    (c) By locking data items to prevent concurrent transactions from accessing the same data.
    (d) By allowing reads to occur without waiting for write locks to be released.
  25. How does a wait-for graph help in resolving deadlocks?
    (a) It visualizes the allocation of CPU time to different transactions.
    (b) It allows a central coordinator to decide whether to grant locks to transactions that request them.
    (c) It detects cycles in resource locks and requests, which indicates the presence of a deadlock.
    (d) It enables a coordinator to schedule processes in a sequence that prevents deadlock.