PracHub
QuestionsLearningGuidesInterview Prep
|Home/Software Engineering Fundamentals/Amazon

Implement a Single-Node Priority Pub/Sub

Last updated: May 23, 2026

Quick Overview

This question evaluates understanding of concurrent system design, in-memory publish–subscribe semantics, prioritized delivery ordering, API and data structure selection, and thread-safety within the Software Engineering Fundamentals domain.

  • medium
  • Amazon
  • Software Engineering Fundamentals
  • Software Engineer

Implement a Single-Node Priority Pub/Sub

Company: Amazon

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: medium

Interview Round: Onsite

Implement a simplified in-memory publish-subscribe system that runs on a single machine. The system should support users subscribing to topics with a priority. ### Requirements 1. A user can subscribe to a topic with an integer priority. 2. A user can unsubscribe from a topic. 3. A publisher can publish a message to a topic. 4. When a message is published, it should be delivered to all current subscribers of that topic in descending priority order. 5. If two subscribers have the same priority, deliver to the one who subscribed earlier first. 6. The implementation should be thread-safe enough to support concurrent subscribe, unsubscribe, and publish calls on a single process. Design the classes, main APIs, data structures, and explain the trade-offs.

Quick Answer: This question evaluates understanding of concurrent system design, in-memory publish–subscribe semantics, prioritized delivery ordering, API and data structure selection, and thread-safety within the Software Engineering Fundamentals domain.

Related Interview Questions

  • Design a Concurrent Restaurant Waitlist and Seating System - Amazon (easy)
  • Implement an Accessible Autocomplete Search Component - Amazon (medium)
  • Debug Watch List Movie Operations - Amazon (medium)
  • Design an advertiser metrics tracking platform - Amazon (medium)
  • Clarify and Solve a Rotate-or-Flip Array Puzzle - Amazon (medium)
|Home/Software Engineering Fundamentals/Amazon

Implement a Single-Node Priority Pub/Sub

Amazon logo
Amazon
Apr 9, 2026, 12:00 AM
mediumSoftware EngineerOnsiteSoftware Engineering Fundamentals
2
0

Implement a simplified in-memory publish-subscribe system that runs on a single machine.

The system should support users subscribing to topics with a priority.

Requirements

  1. A user can subscribe to a topic with an integer priority.
  2. A user can unsubscribe from a topic.
  3. A publisher can publish a message to a topic.
  4. When a message is published, it should be delivered to all current subscribers of that topic in descending priority order.
  5. If two subscribers have the same priority, deliver to the one who subscribed earlier first.
  6. The implementation should be thread-safe enough to support concurrent subscribe, unsubscribe, and publish calls on a single process.

Design the classes, main APIs, data structures, and explain the trade-offs.

Loading comments...

Browse More Questions

More Software Engineering Fundamentals•More Amazon•More Software Engineer•Amazon Software Engineer•Amazon Software Engineering Fundamentals•Software Engineer Software Engineering Fundamentals

Write your answer

Your first approved answer each day earns 20 XP.

Sign in to write your answer.
PracHub

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

Product

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

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding 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.