Katkat

Design a Multi-Channel Message Queue

CerebrasSoftware Engineer · Technical Screen

Last updated

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.

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.