Optiver Software Engineer Interview Experience β€” HackerRank OA: News Subscription System Design

OptiverΒ·Software EngineerΒ·Sep 2025
Online Assessmenthard

βœ… 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:

  • Each subscriber (subscriber) can subscribe to multiple topics
  • Users set a minimum interest score (minInterest) β€” news below this score won't be delivered to them
  • Users also set a maximum receive rate (maxNewsPerSecond) β€” the max number of news items they'll get per second, based on a rolling time window
  • Each news item carries metadata: timestamp, topic, interest score, etc.

🧠 Core design goals

Implement a class NewsProvider supporting the following operations:

AddSubscription(id, minInterest, maxNewsPerSecond, topics) -> bool

  • Add or update a subscription
  • Supports updating an existing subscription with the same ID
  • Returns true on success, false if constraints are violated (e.g. invalid input)

RemoveSubscription(id) -> bool

  • Remove a subscription, returns true on success
  • Returns false if the id doesn't exist

NewsReceived(id, timestamp, interest, topics) -> bool

  • Add a news item, recording its time, interest score, and topics
  • Returns false if the id is a duplicate (the news item already exists)
  • Returns true if it's added successfully

Publish(timestamp, maxAge) -> dict[int, list[int]]

  • For each subscriber, publish the news items that qualify as of the current timestamp
  • Returns a dict mapping each subscriber id to the list of news ids they can receive

Publishing rules:

  • The news item's interest score >= the subscriber's minimum score
  • The news item's topics intersect with the subscriber's topics of interest
  • The news item falls within maxAge (current timestamp - maxAge <= news timestamp <= timestamp)
  • Rolling window limit: each subscriber can receive at most maxNewsPerSecond news items per second
  • The same news item must never be sent to the same subscriber more than once
  • Higher-interest-score news goes out first; ties are broken by older timestamp first, then by ID

πŸ“ Technical focus points and difficulty

PointWhat it involves
Data structure designUse a dict for subscriber info, a set/dict to dedupe news IDs, a queue or time series to support rolling-window stats
Time window handlingmaxNewsPerSecond is based on a rolling (sliding) window β€” every publish call has to look backward from the given timestamp
Sort strategypublish has to sort primarily by interest score, then by time, then by ID β€” this means a custom comparator
Duplicate handlingNo 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:

  • Building the core of a high-performance subscription system
  • Rate-limiting with a sliding time window
  • Deduplication and merge logic
  • Implementing a multi-level sort order
  • Handling edge cases correctly in the implementation

What I'd suggest preparing:

  • Be comfortable combining sliding window + heap + hash map
  • Understand how to implement a topic-based routing/filtering system
  • Be able to quickly build a data model that satisfies all the constraints

Published

Curated and edited by PracHub

Practice the questions from this interview

Discussion

Sign in to join the discussion. The author is notified of every comment.

Loading comments…

Interview at a glance

Company
Optiver
Role
Software Engineer
Rounds
Online Assessment
Difficulty
hard
Interview date
Sep 2025
Questions from this interview
1 question

Real Optiver interview experiences

First-hand reports from Optiver candidates β€” the rounds, the questions they were asked, and how it went.

All 14 Optiver interview experiences