InterviewDB
Question
Article System OOD - Design a News Article Management Service
phone
Question Details
Problem
Design a class hierarchy for an article management system. Support the following operations:
publish(article_id, title, body, author_id, tags)- store and index the article.get(article_id) -> Article- retrieve by ID.search(query) -> List[Article]- full-text search across title and body.by_tag(tag) -> List[Article]-
return all articles with the given tag, sorted by publish time descending.
- by_author(author_id) -> List[Article] - all articles by that author.
python
class Article:
id: str
title: str
body: str
author_id: str
tags: List[str]
published_at: datetime
class ArticleSystem:
def publish(self, title: str, body: str, author_id: str, tags: List[str]) -> Article: ...
def get(self, article_id: str) -> Article: ...
def search(self, query: str) -> List[Article]: ...
def by_tag(self, tag: str) -> List[Article]: ...
def by_author(self, author_id: str) -> List[Article]: ...
Follow-ups
- How would you implement
searchefficiently at scale - what index structure? - How do you handle concurrent
publishcalls without duplicate IDs? - Add a
draftstate so articles are not searchable until explicitly published. - How would you paginate
by_tagresults?
Full Details
Problem
Design a class hierarchy for an article management system. Support the following operations:
publish(article_id, title, body, author_id, tags)- store and index the article.get(article_id) -> Article- retrieve by ID.search(query) -> List[Article]- full-text search across title and body.by_tag(tag) -> List[Article]-
return all articles with the given tag, sorted by publish time descending.
- by_author(author_id) -> List[Article] - all articles by that author.
python
class Article:
id: str
title: str
body: str
author_id: str
tags: List[str]
published_at: datetime
class ArticleSystem:
def publish(self, title: str, body: str, author_id: str, tags: List[str]) -> Article: ...
def get(self, article_id: str) -> Article: ...
def search(self, query: str) -> List[Article]: ...
def by_tag(self, tag: str) -> List[Article]: ...
def by_author(self, author_id: str) -> List[Article]: ...
Follow-ups
- How would you implement
searchefficiently at scale - what index structure? - How do you handle concurrent
publishcalls without duplicate IDs? - Add a
draftstate so articles are not searchable until explicitly published. - How would you paginate
by_tagresults?
Free preview. Unlock all questions →
Topics
Coding
Onsite
Phone
More from Rippling
Reddit
Rippling SDE-2 Phone Screening (Reject)
1p3a
Rippling Software Engineer Interview Experience: AI Coding Rounds and Offer
Reddit
Rippling Fullstack SWE Intern Interview
1p3a
Rippling Fulltime SDE Video Interview Experience: Expense System Challenge
1p3a
Rippling Senior SDE Onsite Interview System Design and Coding