InterviewLegend

Design Voting at Scale

Frequently asked
Alex Chen40 min readUpdated 118 real interview reports

Voting is the little pair of arrows next to every post and comment on Reddit. Tap up or tap down, and the thing's net score (upvotes minus downvotes) moves, feeding into a user's karma and into where the post lands in a community's ranking. It looks like the simplest feature on the site. It is not. A single popular post in a large subreddit can draw hundreds of votes a second. Every one has to change a count and feed a ranking, and it has to survive people trying to rig it.

So the interesting design question is not "how do you add one to a number." The hard version shows up at scale. Adding one happens tens of thousands of times a second. The same user's vote can arrive twice on a flaky connection. The number decides what millions of people see next. And a whole economy of bots is trying to push that number in a direction real users did not. Scope the hour around those four pressures: the write path, idempotency, the ranking recompute, and integrity. The count itself is the easy part.

The Reddit angle
Reddit votes are not written to a counter on the request path, they are enqueued and folded in later, and saying that up front is the signal that you know how Reddit actually works. Reddit's own architecture pushes expensive operations, casting a vote and submitting a link, onto an async job queue (historically RabbitMQ) rather than doing them inline. A worker pulls the vote off the queue, updates the aggregate in a store chosen for availability (Cassandra), and recomputes the ranking. That shape lets the user's tap return immediately while the real work happens behind it. It is also why Reddit's scores wobble on refresh and settle a moment later. A synchronous "increment the row" fights the design Reddit shipped. "Enqueue the vote, ack the user, reconcile async, counts are eventually consistent by design" is Reddit's house style.
What's inside
  • 1 diagram
  • 6 sections
  • about 40 min

Premium lessonReddit interview guide

These took digging.

What candidates walked out with, from 20,000+ reports, forum threads behind logins and write-ups in Chinese. Then solved step by step.

100 companies. Checked every month.

Unlock all 100 companies

$49 a year · less than $1 a week · Cancel anytime

Had your Reddit interview?Tell us what they asked. Reviewed before it goes in, never with your name.
Reddit interview guide

Know what Reddit asks before you walk in.

16 coding · 5 system design · 23 behavioral questions

Get Premium$49 a year · Cancel anytime
Or start freeNo card.

Get their questions first.

InterviewLegend is independent and not affiliated with or endorsed by any company it covers.