🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Design a News Feed: all 10 questions

Quiz: Design a News Feed · Question 7 of 10

What does this print? (code)

What does this print?

followers = {"asha": 120, "virat": 50_000_000, "priya": 300}
LIMIT = 100_000
pushed = sum(n for user, n in followers.items() if n < LIMIT)
print(pushed)
  1. A.50000420
  2. B.420
  3. C.120
  4. D.0
Answer & explanation

Correct answer: 420

Only accounts under the limit are pushed, so one post from each costs 120 + 300 = 420 feed inserts.

Can you get the rest right without peeking?

Take the timed Quiz: Design a News Feed quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →