Optiver Software Engineer Interview Experience โ HackerRank OA: News Subscription System Design
Company: Optiver
Role: Software Engineer
Round: Online Assessment
Seniority: General
Company: Optiver
Role: Software Engineer
Round: Online Assessment
Seniority: General
โ Interview experience summary: News Subscription System design (hands-on HackerRank question)
๐ Problem background (system design)
You're a news aggregation service. The goal is to give users one unified system for subscribing to all news providers, so they only receive content they're interested in without being overloaded with volume. The system needs to manage large data streams efficiently and robustly, and support user-customized subscriptions.
System requirements:
๐ง Core design goals
Implement a class NewsProvider supporting the following operations:
AddSubscription(id, minInterest, maxNewsPerSecond, topics) -> bool
RemoveSubscription(id) -> bool
NewsReceived(id, timestamp, interest, topics) -> bool
Publish(timestamp, maxAge) -> dict[int, list[int]]
Publishing rules:
๐ Technical focus points and difficulty
| Point | What it involves |
|---|---|
| Data structure design | Use a dict for subscriber info, a set/dict to dedupe news IDs, a queue or time series to support rolling-window stats |
| Time window handling | maxNewsPerSecond is based on a rolling (sliding) window โ every publish call has to look backward from the given timestamp |
| Sort strategy | publish has to sort primarily by interest score, then by time, then by ID โ this means a custom comparator |
| Duplicate handling | No news item can be sent twice; you need to track which news IDs each subscriber has already received |
๐ฌ My take as the candidate
Difficulty: โญโญโญโญโญ (system design + implementation detail + multiple combined constraints)
What it's testing:
What I'd suggest preparing: