गुरुर्ब्रह्मा गुरुर्विष्णु गुरुर्देवो महेश्वरा गुरुर्साक्षात परब्रह्म तस्मै श्री गुरवे नमः !
Question 1 In an object-based system, object C1 has a method C1.M1 that calls object C2’s method C2.M2. In which of the following cases is this call NOT a Remote Method Invocation? There may be MULTIPLE ANSWERS. 1 point
C1 and C2 reside in different processes, and the two processes are running on different hosts.
C1 and C2 are on different hosts.
C1 and C2 reside in the same process.
C1 and C2 reside in different processes, but the two processes are running on the same host.
SOLUTION-C1 and C2 reside in the same process.
Question 2 A particular RPC system chooses big-endian representation for its integers. Now consider a little-endian x86 machine (using this RPC system) that needs to send an RPC call with an integer parameter represented in memory as four bytes, with each byte represented in a hexadecimal format. The integer is stored as follows in the x86 machine: (lowest address byte) 12-34-56-78 (highest address byte).
In the marshalled RPC call message, this integer will be stored with: 1 point
12 in its lowest addressed byte
78 in its lowest addressed byte
56 in its lowest addressed byte
None of these options
SOLUTION-78 in its lowest addressed byte
Question 3 Some operations are called idempotent operations because they can be repeated multiple times without any side effects. RPCs that implement idempotent operations are a good fit for at-least-once call semantics. Which of the following functions is NOT idempotent? In the following, y is a local variable held at the server executing the called function, while x is an argument passed by the calling function. (1 point) 1 point
void f(int x) { y = 3; }
void f(int x) { y = x+1; }
int f(int x) { y = x; return y+1; }
int f(int x) { y = y+x; return 1;}
SOLUTION-int f(int x) { y = x; return y+1; }
Question 4 The C in ACID stands for: (1 point) 1 point
Commission
Causality
Consistency
Coldness
SOLUTION-Consistency
Question 5 Which of the following ways will NOT prevent deadlocks from occurring (and persisting)? 1 point
Transactions that are unable to successfully lock objects within a timeout must abort and release all held locks
Transactions are multi-threaded
Objects are acquired only in increasing order of object id, where object ids are integers
Making all objects read-only and allowing only read locks on objects (no write locks).
SOLUTION-Transactions that are unable to successfully lock objects within a timeout must abort and release all held locks
Question 6 Which of the following increases concurrency (TPS) the most, while preserving correctness? 1 point
Optimistic Concurrency Control
None of these options
Pessimistic Concurrency Control with one lock per object
Pessimistic Concurrency Control with read-write locks per object
SOLUTION-Optimistic Concurrency Control
Question 7 In a system supporting read-write locks, which of the following is FALSE? 1 point
A read lock on object O held by transaction T can be promoted only if no other transaction is currently holding a read lock on object O.
A write lock on object O held by transaction T can be shared concurrently with a read lock held by another transaction U on a different object O2.
A transaction T can acquire a read lock on object O only if no other transaction is currently holding a write lock on object O.
A read lock on object O held by transaction T cannot be promoted if another transaction U holds a write lock on any other object O2.
SOLUTION-A read lock on object O held by transaction T cannot be promoted if another transaction U holds a write lock on any other object O2.
Question 8 Which of the following is NOT an optimistic concurrency control technique?
Two-phase locking with read-write locks
Eventual consistency using Las Writes Wins
Never check for consistency violations until commit time; if consistency is detected abort transaction.
Timestamp Ordering Technique
SOLUTION-Timestamp Ordering Technique
Question 8 With a per-replica availability of 1 Nine, what is the minimum number of replicas you need in order to get at least 5 Nines availability for an object? Please enter your answer in numeric value. 1 point
SOLUTION-7
Question 9 In a two-phase commit for transaction T, what is the earliest point of time that a responding can count portion of the transaction T's updates?
SOLUTION-Right after receiving a commit message from the coordinator
Question 9 In a two-phase commit run for transaction T involving 13 servers S1 through S13, all servers other than S8 respond back with a Yes message in the first phase (after receiving the Prepare message from the transaction coordinator), but the coordinator has not yet timed out for the replies. In which of the following cases will the two-phase commit run decide to commit the transaction? There may be MULTIPLE answers. 1 point
S8 crashes after it sends back a Yes message in response to the coordinator’s Prepare message, and the coordinator receives the Yes message before the timeout. S8 does not recover for a long time.
S8 receives the Prepare message but realizes that updates done by transaction T in S8’s memory are corrupted, so it responds back with a “No” to the coordinator.
S8 crashes during the first phase just before it receives the Prepare message, and it does not recover for a long time.
S8 crashes before the first phase and does not recover for a long time.
SOLUTION-
Question 10 Someone builds an active replication system where there is only one front-end, and the front-end for each operation (read or write) forwards only one operation at a time to all the replicas and waits for all of the replicas to respond to the coordinator before sending back an answer to the client. For a read operation, the front-end sends back the highest timestamped value. Which consistency model does this system implement? (Select the most appropriate answer.) 1 point
Eventual consistency
Causal consistency
Monotonic consistency
Linearizability (or a notion of strict consistency)
SOLUTION-Eventual consistency
Question 11 Below you are shown a set of transactions and their operations in the order they are executed in real time.
None of these options
Not serially equivalent
Serially equivalent
SOLUTION-Serially equivalent
Question 12 Two transactions T1 and T2 have instructions as follows (a and b are variables at the server):
T1: write(a, foo, T1); read(b, T1); read(a, T1);
T2: read(b, T2); write(b, bar, T2); write(a, baz, T2);
Above, write parameters are the variable name, variable's new value to be written, and the transaction executing the write. Read parameters are the variable name and the transaction executing the read. Consider the following interleaving: read(b, T2); write(b, bar, T2); write(a, foo, T1); read(b, T1); write(a, baz, T2); read(a, T1). This execution is: 1 point
None of these options
Not serially equivalent
Serially equivalent
SOLUTION-Not serially equivalent
Question 13 Two transactions T1 and T2 have instructions as follows (a and b are variables at the server):
T1: write(a, foo, T1); read(b, T1); read(a, T1);
T2: read(b, T2); write(b, bar, T2); write(a, baz, T2);
Above, write parameters are the variable name, variable's new value to be written, and the transaction executing the write. Read parameters are the variable name and the transaction executing the read. Consider the following interleaving: write(a, foo, T1); read(b, T2); write(b, bar, T2); read(b, T1); write(a, baz, T2); read(a, T1). This execution is: 1 point
Serially equivalent
Not serially equivalent
None of these options
SOLUTION-
Question 14 Below, you are shown a set of transactions and their operations in the order they are executed in real time.
This execution is: 1 point
Not serially equivalent
None of these options
Serially equivalent
SOLUTION-
Question 15 Below, you are shown a set of transactions and their operations in the order they are executed in real time.
This execution is: (1 point)
Serially equivalent
Not serially equivalent
None of these options
SOLUTION-