Design Weekly Comment Digest Service
Design a service responsible for generating and sending a weekly email digest of top comments to post owners.
Requirements:
- Posts receive comments throughout the week.
- Once per week, each post owner should receive an email containing the top
Ncomments for their post. - Comment quality is determined by an external ML scoring service.
- The ML scoring service is rate-limited and cannot score all comments at once at the end of the week.
- The system should scale to many posts and comments, tolerate retries and partial failures, and avoid duplicate emails.
Deliverables:
Describe the architecture, data model, scheduling strategy, how comments are selected and scored over the course of the week, how to handle ML service rate limits, how final ranking is produced, and how the digest email is generated and delivered reliably.
AI interview prep
Core dilemma
Managing the asynchronous processing of high-volume, real-time data (comments) through a rate-limited external dependency (ML scoring service) to produce a consistent, aggregated weekly digest, all while ensuring scalability, fault tolerance, and reliable delivery without duplicates.
3 tradeoffs and 2 stress tests locked
Interview prep
Unlock the interviewer X-Ray rubric, tradeoff matrix, stress tests, clarifying questions, and key concepts.
Design Weekly Comment Digest Service
Design a service responsible for generating and sending a weekly email digest of top comments to post owners.
Requirements:
- Posts receive comments throughout the week.
- Once per week, each post owner should receive an email containing the top
Ncomments for their post. - Comment quality is determined by an external ML scoring service.
- The ML scoring service is rate-limited and cannot score all comments at once at the end of the week.
- The system should scale to many posts and comments, tolerate retries and partial failures, and avoid duplicate emails.
Deliverables:
Describe the architecture, data model, scheduling strategy, how comments are selected and scored over the course of the week, how to handle ML service rate limits, how final ranking is produced, and how the digest email is generated and delivered reliably.