PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/System Design/Cerebras

Design a Multi-Channel Message Queue

Last updated: Jun 16, 2026

Quick Overview

This question evaluates understanding of data modeling for multi-tag messages, set-based subscription semantics, scalable system design, and algorithmic complexity for operations such as enqueue, dequeue, subscribe/unsubscribe, and intersection queries.

  • hard
  • Cerebras
  • System Design
  • Software Engineer

Design a Multi-Channel Message Queue

Company: Cerebras

Role: Software Engineer

Category: System Design

Difficulty: hard

Interview Round: Technical Screen

Design a custom message-queue data structure that supports multiple communication channels per message and channel-based subscriptions for consumers. Extend the design to add additional channels; determine how many channels are needed to cover a given set of producer–consumer communication patterns. Describe how you would represent channel identifiers and use union/intersection operations to detect shared communication channels efficiently. Analyze the time and space complexity of enqueue, dequeue, subscribe/unsubscribe, and channel-query operations.

Quick Answer: This question evaluates understanding of data modeling for multi-tag messages, set-based subscription semantics, scalable system design, and algorithmic complexity for operations such as enqueue, dequeue, subscribe/unsubscribe, and intersection queries.

Cerebras logo
Cerebras
Sep 6, 2025, 12:00 AM
Software Engineer
Technical Screen
System Design
8
0

Design a Message Queue with Multi-Channel Messages and Channel-Based Subscriptions

Context

You are asked to design a message-queue data structure where:

  • Each message may belong to multiple communication channels (tags).
  • Consumers subscribe to channels and should receive messages if they share at least one channel with the message.
  • The system must support adding new channels dynamically, efficient detection of shared channels via union/intersection, and analysis of operation complexities.
  • Additionally, given a set of desired producer–consumer communication pairs, determine how many channels are needed and how to assign them to cover these patterns.

Requirements

  1. Data model where messages can have multiple channels and consumers subscribe to channels.
  2. Efficient operations:
    • Enqueue message
    • Dequeue/consume message
    • Subscribe/Unsubscribe consumer to channels
    • Query shared channels (e.g., does message M intersect consumer C’s subscriptions?)
  3. Representation of channel identifiers enabling fast union/intersection.
  4. Support adding channels at runtime.
  5. Analyze time and space complexity for all operations.
  6. Given a set of producer–consumer communication patterns, determine the minimum (or a good) number of channels required and how to assign them.

Solution

Show

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More System Design•More Cerebras•More Software Engineer•Cerebras Software Engineer•Cerebras System Design•Software Engineer System Design
PracHub

Master your tech interviews with 8,000+ 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.