By: Prof. Dr. Fazal Rehman | Last updated: September 23, 2024
Which consistency model ensures that all transactions in a distributed system appear to occur instantaneously at some point between their start and end times?
a) Eventual Consistency
b) Strong Consistency
c) Causal Consistency
d) Snapshot IsolationAnswer: b) Strong Consistency
In which consistency model does a read operation reflect the most recent write operation by the same user?
a) Session Consistency
b) Eventual Consistency
c) Causal Consistency
d) LinearizabilityAnswer: a) Session Consistency
Which of the following consistency models ensures that operations are ordered according to their causal relationships?
a) Eventual Consistency
b) Causal Consistency
c) Linearizability
d) Snapshot IsolationAnswer: b) Causal Consistency
What is the primary objective of the Two-Phase Commit (2PC) protocol in distributed transactions?
a) To achieve high availability of data
b) To ensure that all participating nodes commit or abort a transaction atomically
c) To reduce network latency
d) To provide eventual consistency across distributed nodesAnswer: b) To ensure that all participating nodes commit or abort a transaction atomically
Which protocol is commonly used to ensure that distributed systems reach consensus on the order of transactions?
a) Two-Phase Commit Protocol
b) Paxos Protocol
c) Raft Protocol
d) Quorum ProtocolAnswer: b) Paxos Protocol
What does the Raft protocol primarily focus on in distributed systems?
a) Data encryption
b) Log replication and leader election
c) Query optimization
d) Data fragmentationAnswer: b) Log replication and leader election
Which consistency model guarantees that a read operation always returns the most recent write operation in the entire system?
a) Eventual Consistency
b) Read-Your-Writes Consistency
c) Linearizability
d) Causal ConsistencyAnswer: c) Linearizability
In the context of distributed databases, what does ‘quorum’ refer to?
a) A mechanism for encryption
b) A set of nodes that must agree on a transaction or operation
c) The process of data backup
d) The replication factorAnswer: b) A set of nodes that must agree on a transaction or operation
What is ‘Read-Your-Writes Consistency’?
a) A consistency model where any read reflects the most recent write by the same user
b) A consistency model where reads reflect the latest writes from any user
c) A protocol ensuring all nodes are up-to-date
d) A mechanism for data encryptionAnswer: a) A consistency model where any read reflects the most recent write by the same user
Which consistency model allows a system to return stale data but ensures that once a write is visible, all subsequent reads will reflect that write?
a) Eventual Consistency
b) Causal Consistency
c) Snapshot Isolation
d) Strong ConsistencyAnswer: c) Snapshot Isolation
In distributed systems, what does the ‘Quorum-Based Protocol’ help to achieve?
a) High availability of data
b) Data encryption
c) Consistency by requiring a majority of nodes to agree on read and write operations
d) Improved network performanceAnswer: c) Consistency by requiring a majority of nodes to agree on read and write operations
What does ‘Eventual Consistency’ guarantee in a distributed system?
a) All nodes will have the same data immediately after a write operation
b) Updates to data will eventually propagate to all nodes, but may not be immediately consistent
c) Reads will always return the most recent write
d) Writes will always be visible immediatelyAnswer: b) Updates to data will eventually propagate to all nodes, but may not be immediately consistent
Which protocol is designed to handle distributed systems where nodes may fail and recover while still maintaining consistency?
a) Two-Phase Commit Protocol
b) Paxos Protocol
c) Raft Protocol
d) Quorum ProtocolAnswer: b) Paxos Protocol
What is a key feature of the Two-Phase Commit Protocol?
a) It uses timestamps to order transactions
b) It involves a preparation phase where all nodes agree to commit or abort a transaction
c) It replicates logs across nodes for fault tolerance
d) It allows eventual consistencyAnswer: b) It involves a preparation phase where all nodes agree to commit or abort a transaction
Which consistency model is often used in systems that require high availability and can tolerate temporary inconsistencies?
a) Linearizability
b) Eventual Consistency
c) Causal Consistency
d) Snapshot IsolationAnswer: b) Eventual Consistency