Design the voting and content ranking system for a Reddit-like platform. Users submit posts to topic-based communities, vote posts up or down, and browse feeds ranked by "Hot" (recent + popular), "Top" (most upvoted in a time period), "New" (chronological), and "Controversial" (high engagement, mixed votes). The system has 50 million daily active users, 1 million posts per day, and 500 million votes per day.
In your 90-second answer, cover: - Vote processing pipeline handling 500M votes/day with consistency guarantees (no double-voting) - Ranking algorithms for Hot, Top, and Controversial with their tradeoffs - How you recompute and serve rankings efficiently (pre-computed vs. on-the-fly) - Anti-gaming measures: preventing vote manipulation (bot rings, self-voting with alts)
Constraints: vote counts must be accurate (eventual consistency within 5 seconds). Rankings must update within 30 seconds of vote activity. Feed pages must load in under 300ms.
How to approach it
- Hint 1
The Hot ranking algorithm is the heart of Reddit. Research Reddit's actual formula: it combines the logarithm of the net vote score with a time decay factor, giving newer posts a boost that fades over time. This means a post needs exponentially more votes to stay at the top as it ages.
- Hint 2
At 500M votes/day (~5,800/sec), you cannot recompute rankings on every vote. Use a write-behind pattern: accumulate votes, periodically recompute rankings, and serve from a pre-computed cache.
- Hint 3
Vote manipulation detection is an adversarial problem. Look for patterns: rapid votes from new accounts, votes always on the same targets, votes from the same IP ranges. This is a separate offline pipeline, not inline with vote processing.
Ready to answer it out loud?
Record your answer in 1:30 and Preptile scores it 1–10 with specifics — what landed, what you skipped, and what to say next time.
Practising needs an invite code. Join the waitlist and we’ll send you one.