Back to problems

Recent Like Count and Top Posts in a Sliding Window

System Design · ByteDance · Medium

Requirements Create a social-network backend that exposes these three read operations: For a supplied post_id, report how many likes that post received during the preceding 60 seconds. List the posts with the highest like totals worldwide over the preceding 60 seconds. List the highest-liked posts for each region over the preceding 60 seconds. Plan for roughly 1M likes per second at peak and 100K–300K likes per second on average. Establish whether the 60-second interval…

Checking your access…