PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches
|Home/Software Engineering Fundamentals/Hot Agent Startup

Implement a Thread-Safe Pub-Sub Service

Last updated: May 23, 2026

Quick Overview

This question evaluates concurrent programming and thread-safety skills within the Software Engineering Fundamentals domain, focusing on synchronization primitives, message delivery semantics, and coordination between publishers and subscribers at a practical application level.

  • medium
  • Hot Agent Startup
  • Software Engineering Fundamentals
  • Software Engineer

Implement a Thread-Safe Pub-Sub Service

Company: Hot Agent Startup

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: medium

Interview Round: Onsite

Implement a simple server-side publish-subscribe system using Python's standard `threading` library. Requirements: - Multiple publisher threads may publish messages concurrently. - Multiple subscriber threads may subscribe to topics concurrently. - A subscriber can subscribe to and unsubscribe from a topic. - When a message is published to a topic, all currently subscribed subscribers should receive the message. - The implementation must avoid race conditions and deadlocks. - Use Python threading primitives such as `Lock`, `RLock`, `Condition`, `Event`, and thread-safe queues where appropriate. - Discuss delivery semantics, shutdown behavior, and how to avoid one slow subscriber blocking all publishers.

Quick Answer: This question evaluates concurrent programming and thread-safety skills within the Software Engineering Fundamentals domain, focusing on synchronization primitives, message delivery semantics, and coordination between publishers and subscribers at a practical application level.

Hot Agent Startup logo
Hot Agent Startup
Apr 3, 2026, 12:00 AM
Software Engineer
Onsite
Software Engineering Fundamentals
0
0

Implement a simple server-side publish-subscribe system using Python's standard threading library.

Requirements:

  • Multiple publisher threads may publish messages concurrently.
  • Multiple subscriber threads may subscribe to topics concurrently.
  • A subscriber can subscribe to and unsubscribe from a topic.
  • When a message is published to a topic, all currently subscribed subscribers should receive the message.
  • The implementation must avoid race conditions and deadlocks.
  • Use Python threading primitives such as Lock , RLock , Condition , Event , and thread-safe queues where appropriate.
  • Discuss delivery semantics, shutdown behavior, and how to avoid one slow subscriber blocking all publishers.

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Software Engineering Fundamentals•More Hot Agent Startup•More Software Engineer•Hot Agent Startup Software Engineer•Hot Agent Startup Software Engineering Fundamentals•Software Engineer Software Engineering Fundamentals
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.