🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Quiz: Consistent Hashing: questions with answers

15 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. With hash(key) % N, roughly what share of keys moves when going from 4 to 5 servers?
  2. Q2. On a consistent hash ring, which server owns a key?
  3. Q3. What does this print? (code)
  4. Q4. A new server E is added to a ring of four servers. Which keys move?
  5. Q5. What problem do virtual nodes mainly solve?
  6. Q6. A server with double the RAM should hold double the keys. How do you do this with consistent hashing?
  7. Q7. What does this print? (code)
  8. Q8. Why should you not use Python's built-in hash() for strings to place keys on a ring?
  9. Q9. With replication factor 3 on a ring, where is a key stored?
  10. Q10. When a server with many virtual nodes crashes, what happens to its keys?
  11. Q11. A cache cluster uses hash(key) % N and one of its 4 servers crashes. Why is this so harmful?
  12. Q12. On a ring with servers at positions 100, 200 and 300 (out of 360), a key hashes to 350. Which server owns it?
  13. Q13. What does this print? (code)
  14. Q14. With consistent hashing, roughly what share of keys should move when one server is added to N servers?
  15. Q15. What does Redis Cluster use instead of a hash ring?