Quiz Assignment-IV Solutions: Cloud Computing and Distributed Systems (Week-4)
_________________________________________________________________________
Q. 1 Assign Lamport timestamps to the events (a, b, c, d, e, f) as shown in the figure:
A. a: 6, b: 2, c: 6, d: 7, e: 7, f: 8
B. a: 1, b: 2, c: 2, d: 3, e: 4, f: 2
C. a: 6, b: 7, c: 6, d: 7, e: 7, f: 8
D. a: 6, b: 7, c: 6, d: 7, e: 8, f: 9
Answer: D) a: 6, b: 7, c: 6, d: 7, e: 8, f: 9
Explanation: Solved by the property of Scalar Time
ts = max(local, msg) + 1
ts(a): max(5,0)+1=6, ts(b): max(6,1)+1=7, ts(c): max(1,5)+1=6,
ts(d): max(6,5)+1=7, ts(e): max(7,6)+1=8, ts(f): max(1,8)+1=9
Q. 2 Which event is concurrent with the vector clock (2, 7, 3) ?
A. (4, 9, 4)
B. (1, 7, 4)
C. (1, 5, 1)
D. (5, 7, 3)
Answer: B) (1, 7, 4)
Explanation: Two events VT1 and VT2 are concurrent
iff
NOT (VT1 ≤ VT2) AND NOT (VT2 ≤ VT1)
If we do an element-by element comparison:
(1, 7, 4) is neither ≥ nor ≤ to (2, 7, 3)
1 < 2, 7 = 7, 4 > 3.
Q. 3 A client gets a timestamp of 3:12:30.500 from a time server. The elapsed time between
the request and response was 20 msec (0.020 sec). The current time on the client is
3:12:30.510. Using Cristian’s algorithm i.e. server time + ½(elapsed time), what is the time
set on the client?
A. 3:12:30.480
B. 3:12:30.490
C. 3:12:30.510
D. 3:12:30.520
Answer: C) 3:12:30.510
Explanation: Cristian’s algorithm sets the time to:
server time + ½(elapsed time)
= 3:12:30.500 + 0.020/2
= 3:12:30.500 + 0.010
= 3:12:30.510
Q. 4 A client's clock reads 3:20:00. The server's clock reads 3:10:00 when they synchronize
using the Berkeley algorithm. Assume message delays are negligible. What is the time at the
client after synchronization?
A. 3:20:00
B. 3:10:00
C. 6:30:00
D. 3:15:00
Answer: D) 3:15:00
Explanation:
The Berkeley algorithm averages clocks among the entire group. In this case, the group has
two members: the client and the server. The average of the two clocks is (3:20:00 +
3:10:00)/2 = 3:15. Both the client and server will be set to 3:15.
Q. 5 True or False ?
DTP (Datacenter Time Protocol) uses the physical layer of network devices to implement a
decentralized clock synchronization protocol.
A. True
B. False
Answer: A) True
Explanation: DTP (Datacenter Time Protocol) uses the physical layer of network devices to
implement a decentralized clock synchronization protocol.
Q. 6 The properties hold for quorums in a coterie are:
A. Total ordered set property
B. Intersection property
C. Minimality property
D. Both Intersection and Minimality property
Answer: D) Both Intersection and Minimality property
The following properties hold for quorums in a coterie:
Intersection property: For every quorum g, h ∈ C, g ∩ h ≠ ∅.
For example, sets {1,2,3}, {2,5,7} and {5,7,9} cannot be quorums in a coterie, because first
and third sets do not have a common element.
Minimality property: There should be no quorums g, h in coterie C such that g ⊇ h i.e g is
superset of h.
For example, sets {1,2,3} and {1,3} cannot be quorums in a coterie because the first set is a
superset of the second.
Q. 7 True or False ?
The Chandy-Lamport global snapshot algorithm works correctly for non-FIFO channels.
A. True
B. False
Answer: B) False
Explanation: The Chandy-Lamport global snapshot algorithm works correctly for FIFO
channels.
Q. 8 Find out the correct property to solve mutual exclusion in distributed system:
Property 1: At most one process executes in critical section at any time
Property 2: Every request for a critical section is granted eventually
Property 3: Requests are granted in the order they were made
A. Property 1: Liveness, Property 2: Fairness, Property 3: Safety
B. Property 1: Safety, Property 2: Fairness, Property 3: Liveness
C. Property 1: Fairness, Property 2: Safety, Property 3: Liveness
D. Property 1: Safety, Property 2: Liveness, Property 3: Fairness
Answer: D) Property 1: Safety, Property 2: Liveness, Property 3: Fairness
Explanation: Safety (essential): At most one process executes in CS (Critical Section) at any
time
Liveness (essential): Every request for a CS is granted eventually
Fairness (desirable): Requests are granted in the order they were made
Q. 9 Consider the following statements:
Statement 1: Lamport’s algorithm achieves mutual exclusion.
Statement 2: Lamport’s algorithm is fair.
A. Only statement 1 is true
B. Only statement 2 is true
C. Both statements are true
D. Both statements are false
Answer: C) Both statements are true
Q. 10 ___________________provides Advisory locks only and doesn’t guarantee mutual
exclusion unless every client checks lock before accessing resource.
A. Paxos
B. Google’s Chubby
C. Cassandra
D. Microsoft Azure
Answer: B) Google’s Chubby
___________________________________________________________________________