89% found this document useful (9 votes)
7K views11 pages

Homework 4 Coursera 07 PDF

This document contains a 25-point homework assignment on distributed systems topics. It includes multiple choice questions testing knowledge of concepts like Cassandra data placement, consistency levels, eventual consistency, Lamport timestamps, vector timestamps, and Bloom filters. The questions cover topics related to NoSQL databases, distributed coordination, and consistency models.

Uploaded by

PrabhatMishra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
89% found this document useful (9 votes)
7K views11 pages

Homework 4 Coursera 07 PDF

This document contains a 25-point homework assignment on distributed systems topics. It includes multiple choice questions testing knowledge of concepts like Cassandra data placement, consistency levels, eventual consistency, Lamport timestamps, vector timestamps, and Bloom filters. The questions cover topics related to NoSQL databases, distributed coordination, and consistency models.

Uploaded by

PrabhatMishra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Homework 4

TOTAL POINTS 25

1. A Cassandra deployment with 6 (N1 through N6) nodes across three racks: N1 and 1 point
N6 are in rack 1; N2 and N5 in rack 2; N3 and N4 in rack 3. The Cassandra ring has
the nodes in the following clockwise order: N1, N2, N3, N4, N5, N6. The
NetworkTopologyStrategy is attempting to place 2 replicas of a given key. The first
replica is placed by the partitioner at N3. The second replica will be placed at node:
(1 point)

N5

N1

N2

N6

2. A Cassandra deployment uses the RackInferringSnitch. Two addresses 123.1.23.34 1 point


and 123.1.23.123: (1 point)

Belong to the same datacenter but different racks

Belong to the same rack but are different machines

Are the same machine

Belong to different datacenters

3. A Cassandra-like key-value store system uses write consistency level of size W 1 point
and read level of size R. There are N replicas of each key, and N is an even integer
that is large enough. You are told that to maintain the strong consistency needed
by your application, all conflicting writes must be detected by at least one replica
(i.e., any two sets of written replicas must overlap) and a read must return the value
of the latest acknowledged write (i.e., a read replica set must overlap with every
written replica set). Which of the following combinations does NOT maintain strong
consistency? (1 point)

W=N/2+1, R=N/2-1

W=N/2+2, R=N/2-1

W=N-1; R=2

W=N/2+1, R=N/2+1
4. A BASE system implements implies: (1 point) 1 point

Meaningful consistency

Eventual consistency

Sequential consistency

No consistency

5. The best definition of eventual consistency says that: (1 point) 1 point

If writes stop to a key, then all replicas of the key will eventually reflect the same
value

A read from a client will be answered eventually

If reads stop to a key, then all replicas of the key will eventually reflect the same
value

A write from a client will be answered eventually

6. In HBase, which of the following entities is stored in-memory? (1 point) 1 point

HRegionServer

MemStore

Store

StoreFiles

7. In Cassandra, when a write comes in at a replica, it is immediately: (1 point) 1 point

Stored in memory into an SSTable

Stored in memory into a Memtable

Stored on disk into a Memtable

Stored on disk into an SSTable

8. Someone gives you an arbitrary run (execution) trace from a system that 1 point
implements eventual consistency. It is impossible that this run: (1 point)

Satisfies causal consistency


Returns an answer for a read from a write which was issued by a client after the
read result was received at the client

Returns an answer for a read from a write which was acknowledged at a client after
the read result was received at the client

Returns an answer for a read from a write that was issued by a client after the read
was issued by the client

9. A system using Lamport timestamps executes the following run shown in below. 1 point
Initially, all four processes start with sequence numbers containing all zeros. An
arrow shows a message, and each darkened circle shows a process instruction.

Answer the following question. (1 point)

In this run (execution), the total number of events summed across all processes
is:

25

10. A system using Lamport timestamps executes the following run shown in below. 1 point
Initially, all four processes start with sequence numbers containing all zeros. An
arrow shows a message, and each darkened circle shows a process instruction.
Answer the following question. (1 point)

The Lamport timestamp carried by the first message sent from P0 to P2 is:

11. A system using Lamport timestamps executes the following run shown in below. 1 point
Initially, all four processes start with sequence numbers containing all zeros. An
arrow shows a message, and each darkened circle shows a process instruction.

Answer the following question. (1 point)

The Lamport timestamp carried by the first message sent from P0 to P2 is:

12. A system using Lamport timestamps executes the following run shown in below. 1 point
Initially, all four processes start with sequence numbers containing all zeros. An
arrow shows a message, and each darkened circle shows a process instruction.

Answer the following question. (1 point)


The ending Lamport timestamp at process P3 is:

13

13. A system using Lamport timestamps executes the following run shown in below. 1 point
Initially, all four processes start with sequence numbers containing all zeros. An
arrow shows a message, and each darkened circle shows a process instruction.

Answer the following question. (1 point)

The process with the highest Lamport timestamp at the end of this run is:

P2

P0

P1

P3

14. A system using Lamport timestamps executes the following run shown in below. 1 point
Initially, all four processes start with sequence numbers containing all zeros. An
arrow shows a message, and each darkened circle shows a process instruction.
Answer the following question. (1 point)

The number of events with a Lamport timestamp of 8 is:

15. A system using Lamport timestamps executes the following run shown in below. 1 point
Initially, all four processes start with sequence numbers containing all zeros. An
arrow shows a message, and each darkened circle shows a process instruction.

Answer the following question. (1 point)

The comma-separated list of Lamport timestamps to the last 3 events at P3 is:

Please ensure you enter answers in increasing order of integers.

8, 12, 13

16. A system using vector timestamps executes the following run. Initially, all four 1 point
processes start with vectors containing all zeros, i.e., each process starts at
0,0,0,0. An arrow shows a message, and each darkened circle shows a process
instruction.
Answer the following question. Note: Please represent your vector timestamps as a
comma-separated list (without the brackets). (1 point)

The ending vector timestamp at P1 is:

5, 8, 6, 5

17. A system using vector timestamps executes the following run. Initially, all four 1 point
processes start with vectors containing all zeros, i.e., each process starts at
0,0,0,0. An arrow shows a message, and each darkened circle shows a process
instruction.

Answer the following question. Note: Please represent your vector timestamps as a
comma-separated list (without the brackets). (1 point)

The vector timestamp of the only process instruction at P2 is:

1, 0, 4, 0

18. A system using vector timestamps executes the following run. Initially, all four 1 point
processes start with vectors containing all zeros, i.e., each process starts at
0,0,0,0. An arrow shows a message, and each darkened circle shows a process
instruction.
Answer the following question. Note: Please represent your vector timestamps as a
comma-separated list (without the brackets). (1 point)

The receipt vector timestamp of the last message received at P2 is:

4, 2, 9, 1

19. A system using vector timestamps executes the following run. Initially, all four 1 point
processes start with vectors containing all zeros, i.e., each process starts at
0,0,0,0. An arrow shows a message, and each darkened circle shows a process
instruction.

Answer the following question. Note: Please represent your vector timestamps as a
comma-separated list (without the brackets). (1 point)

The receipt timestamp of the last message received at P0 is:

7, 2, 8, 6

20. A system using vector timestamps executes the following run. Initially, all four 1 point
processes start with vectors containing all zeros, i.e., each process starts at
0,0,0,0. An arrow shows a message, and each darkened circle shows a process
instruction.

Answer the following question. (1 point)

The number of events concurrent with the send event of the only message sent
from P1 to P2 is:

21. Your boss loves Bloom filters. To impress her, you start implementing one. Your 1 point
Bloom filter uses m=32 bits and 3 hash functions h1, h2, and h3, where hi(x) =
((x2 +x3)*i) mod m.

In this case, answer the following question. (1 point)

Starting from an empty Bloom filter, you’ve inserted the following two elements:
2010, 2013. Note the bits in the Bloom filter have positions numbered 0 through
31. At the end of these insertions, which of the following bits IS NOT set to 1?

24

10

16

12

22. Your boss loves Bloom filters. To impress her, you start implementing one. Your 1 point
Bloom filter uses m=32 bits and 3 hash functions h1, h2, and h3, where hi(x) =
((x2 +x3)*i) mod m.

In this case, answer the following question. (1 point)


Starting from an empty Bloom filter, you’ve inserted the following three
elements: 2010, 2013, 2007. Now some bits are set. Now, you insert the fourth
element 2004. Note the bits in the Bloom filter have positions numbered 0
through 31. The bits whose values will change when the fourth element 2004 is
inserted INCLUDE:

10

24

23. Your boss loves Bloom filters. To impress her, you start implementing one. Your 1 point
Bloom filter uses m=32 bits and 3 hash functions h1, h2, and h3, where hi(x) =
((x2 +x3)*i) mod m.

In this case, answer the following question. (1 point)

Starting from an empty Bloom filter, you’ve inserted the following elements:
2013, 2010, 2007, 2004, 2001, 1998. If someone checks for membership of the
element 0, it will be found to be:

A false negative

In the Bloom filter and not a false positive

Indeterminate since it was never inserted into the Bloom filter

In the Bloom filter and hence a false positive

24. Your boss loves Bloom filters. To impress her, you start implementing one. Your 1 point
Bloom filter uses m=32 bits and 3 hash functions h1, h2, and h3, where hi(x) =
((x2 +x3)*i) mod m.

In this case, answer the following question. (1 point)

Starting from an empty Bloom filter, you’ve inserted the following elements:
2013, 2010, 2007, 2004, 2001, 1998. If someone checks for membership of the
element 3200, it will be found to be:

In the Bloom filter and hence a false positive

A false negative
Not in the Bloom filter

Indeterminate since it was never inserted into the Bloom filter

25. Calibrations on a recent version of an operating system showed that on the client 1 point
side, there is a delay of at least 0.5 ms for a packet to get from an application to the
network interface and a delay of 1.4 ms for the opposite path (network interface to
application buffer). The corresponding minimum delays for the server are 0.20 ms
and 0.30 ms, respectively.

What would be the accuracy of a run of the Cristian's algorithm between a client
and server, both running this version of Linux, if the round trip time measured at
the client is 6.6 ms?

0.2 ms

0.3 ms

4.2 ms

2.1 ms

I understand that submitting work that isn’t my own may result in permanent failure of this course or
deactivation of my Coursera account.
Learn more about Coursera’s Honor Code

You might also like