🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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)
  1. A.True True
  2. B.True False
  3. C.False False
  4. 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 →