PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/System Design/Optiver

Design a subscription push service

Last updated: Apr 19, 2026

Quick Overview

This question evaluates object-oriented system design skills and knowledge of publish/subscribe messaging, delivery semantics (at-most-once delivery, ordering, idempotency), concurrency control, persistence models, failure handling, and scalability in the System Design domain.

  • hard
  • Optiver
  • System Design
  • Software Engineer

Design a subscription push service

Company: Optiver

Role: Software Engineer

Category: System Design

Difficulty: hard

Interview Round: Technical Screen

Design an object-oriented publish/subscribe notification service for user–topic subscriptions. Implement APIs: addSubscription(userId, topicId), unsubscribe(userId, topicId), publishNews(topicId, newsId, payload), and onNewsReceived(userId, newsId) to acknowledge delivery. Ensure each published item is delivered at most once to currently subscribed users, that unsubscribes prevent future deliveries, and provide per-topic per-user ordering guarantees. Describe class/interface design, in-memory and persistence data models, concurrency control, failure handling, and how you would scale to millions of users. Analyze the time and space complexity of core operations.

Quick Answer: This question evaluates object-oriented system design skills and knowledge of publish/subscribe messaging, delivery semantics (at-most-once delivery, ordering, idempotency), concurrency control, persistence models, failure handling, and scalability in the System Design domain.

Related Interview Questions

  • Design low-latency trading infrastructure - Optiver (hard)
  • Design a topic-based news subscription system - Optiver (hard)
  • Design a satellite propagation simulator - Optiver (hard)
Optiver logo
Optiver
Jul 17, 2025, 12:00 AM
Software Engineer
Technical Screen
System Design
30
0

Object-Oriented Design: Publish/Subscribe Notification Service

Design an object-oriented publish/subscribe notification service for user–topic subscriptions.

Provide the following APIs:

  • addSubscription(userId, topicId)
  • unsubscribe(userId, topicId)
  • publishNews(topicId, newsId, payload)
  • onNewsReceived(userId, newsId) // client acknowledgement

Requirements:

  1. Delivery semantics
    • Each published item is delivered at most once to users who are subscribed at the time of delivery.
    • Unsubscribes prevent any future deliveries for that user–topic pair, including items published earlier but not yet delivered.
    • Per-topic per-user ordering: for a given user and topic, deliver items in the order they were published to that topic.
  2. Design deliverables
    • Class/interface design for the service and its components.
    • In-memory and persistence data models.
    • Concurrency control (ordering, idempotency, race handling).
    • Failure handling (restarts, partial failures, retries policy).
    • Scalability plan to millions of users.
    • Time and space complexity analysis of core operations.

Assume:

  • newsId is unique per topic (idempotency key).
  • Per-topic ordering is defined by a monotonically increasing sequence (offset) assigned at publish time.
  • If a user unsubscribes after a publish but before delivery, do not deliver that item.
  • New subscriptions start from the current end of the topic (no historical replay).

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More System Design•More Optiver•More Software Engineer•Optiver Software Engineer•Optiver System Design•Software Engineer System Design
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.