← Quiz: Scaling and Load Balancing: all 10 questions
Quiz: Scaling and Load Balancing · Question 7 of 10
What does this print? (code)
What does this print?
servers = ["S1", "S2", "S3"]
picked = [servers[i % len(servers)] for i in range(5)]
print(picked)
- A.['S1', 'S2', 'S3', 'S3', 'S3']
- B.['S1', 'S2', 'S3', 'S1', 'S2']
- C.['S1', 'S1', 'S2', 'S2', 'S3']
- D.['S2', 'S3', 'S1', 'S2', 'S3']
Answer & explanation
Correct answer: ['S1', 'S2', 'S3', 'S1', 'S2']
Round robin cycles through the servers in order: 1, 2, 3, 1, 2.
Can you get the rest right without peeking?
Take the timed Quiz: Scaling and Load Balancing quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →