← Quiz: Consistency and Quorums: all 10 questions
Quiz: Consistency and Quorums · Question 2 of 10
What does this print? (code)
What does this print?
from itertools import combinations
n, w, r = 4, 2, 2
ok = all(set(a) & set(b) for a in combinations(range(n), w) for b in combinations(range(n), r))
print(ok, w + r > n)
- A.True True
- B.True False
- C.False False
- D.False True
Answer & explanation
Correct answer: False False
With 4 replicas, the write could go to {0, 1} and the read to {2, 3}; 2 + 2 is not greater than 4.
Can you get the rest right without peeking?
Take the timed Quiz: Consistency and Quorums quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →